mirror of
https://github.com/drone-plugins/drone-npm.git
synced 2026-06-04 18:23:52 +08:00
Updated to current build process
This commit is contained in:
@@ -0,0 +1,68 @@
|
||||
version: '{build}'
|
||||
image: 'Visual Studio 2017'
|
||||
platform: 'x64'
|
||||
|
||||
clone_folder: 'c:\gopath\src\github.com\drone-plugins\drone-npm'
|
||||
max_jobs: 1
|
||||
|
||||
environment:
|
||||
GOPATH: c:\gopath
|
||||
DOCKER_USERNAME:
|
||||
secure: '4YzzahbEiMZQJpOCOd1LAw=='
|
||||
DOCKER_PASSWORD:
|
||||
secure: 'VqO/G3Zfslu6zSLdwHKO+Q=='
|
||||
|
||||
install:
|
||||
- ps: |
|
||||
docker version
|
||||
go version
|
||||
- ps: |
|
||||
$env:Path = "c:\gopath\bin;$env:Path"
|
||||
|
||||
build_script:
|
||||
- ps: |
|
||||
go get -u github.com/golang/dep/cmd/dep
|
||||
dep ensure
|
||||
|
||||
if ( $env:APPVEYOR_REPO_TAG -eq 'false' ) {
|
||||
go build -ldflags "-X main.build=$env:APPVEYOR_BUILD_VERSION" -a -o release/drone-npm.exe
|
||||
} else {
|
||||
$version = $env:APPVEYOR_REPO_TAG_NAME.substring(1)
|
||||
go build -ldflags "-X main.version=$version -X main.build=$env:APPVEYOR_BUILD_VERSION" -a -o release/drone-npm.exe
|
||||
}
|
||||
|
||||
docker pull microsoft/nanoserver:10.0.14393.1593
|
||||
docker build -f Dockerfile.windows -t plugins/npm:windows-amd64 .
|
||||
|
||||
test_script:
|
||||
- ps: |
|
||||
docker run --rm plugins/npm:windows-amd64 --version
|
||||
|
||||
deploy_script:
|
||||
- ps: |
|
||||
$ErrorActionPreference = 'Stop';
|
||||
|
||||
if ( $env:APPVEYOR_PULL_REQUEST_NUMBER ) {
|
||||
Write-Host Nothing to deploy.
|
||||
} else {
|
||||
docker login --username $env:DOCKER_USERNAME --password $env:DOCKER_PASSWORD
|
||||
|
||||
if ( $env:APPVEYOR_REPO_TAG -eq 'true' ) {
|
||||
$major,$minor,$patch = $env:APPVEYOR_REPO_TAG_NAME.substring(1).split('.')
|
||||
|
||||
docker push plugins/npm:windows-amd64
|
||||
|
||||
docker tag plugins/npm:windows-amd64 plugins/npm:$major.$minor.$patch-windows-amd64
|
||||
docker push plugins/npm:$major.$minor.$patch-windows-amd64
|
||||
|
||||
docker tag plugins/npm:windows-amd64 plugins/npm:$major.$minor-windows-amd64
|
||||
docker push plugins/npm:$major.$minor-windows-amd64
|
||||
|
||||
docker tag plugins/npm:windows-amd64 plugins/npm:$major-windows-amd64
|
||||
docker push plugins/npm:$major-windows-amd64
|
||||
} else {
|
||||
if ( $env:APPVEYOR_REPO_BRANCH -eq 'master' ) {
|
||||
docker push plugins/npm:windows-amd64
|
||||
}
|
||||
}
|
||||
}
|
||||
+88
-48
@@ -3,15 +3,22 @@ workspace:
|
||||
path: src/github.com/drone-plugins/drone-npm
|
||||
|
||||
pipeline:
|
||||
test:
|
||||
image: golang:1.9
|
||||
deps:
|
||||
image: golang:1.10
|
||||
pull: true
|
||||
commands:
|
||||
- go vet
|
||||
- go test -cover -coverprofile=coverage.out
|
||||
- go get -u github.com/golang/dep/cmd/dep
|
||||
- dep ensure
|
||||
|
||||
test:
|
||||
image: golang:1.10
|
||||
pull: true
|
||||
commands:
|
||||
- go vet ./...
|
||||
- go test -cover ./...
|
||||
|
||||
build_linux_amd64:
|
||||
image: golang:1.9
|
||||
image: golang:1.10
|
||||
pull: true
|
||||
group: build
|
||||
environment:
|
||||
@@ -19,10 +26,31 @@ pipeline:
|
||||
- GOARCH=amd64
|
||||
- CGO_ENABLED=0
|
||||
commands:
|
||||
- go build -v -ldflags "-X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/amd64/drone-npm
|
||||
- |
|
||||
if test "${DRONE_TAG}" = ""; then
|
||||
go build -v -ldflags "-X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/amd64/drone-npm
|
||||
else
|
||||
go build -v -ldflags "-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/amd64/drone-npm
|
||||
fi
|
||||
|
||||
# build_linux_i386:
|
||||
# image: golang:1.10
|
||||
# pull: true
|
||||
# group: build
|
||||
# environment:
|
||||
# - GOOS=linux
|
||||
# - GOARCH=386
|
||||
# - CGO_ENABLED=0
|
||||
# commands:
|
||||
# - |
|
||||
# if test "${DRONE_TAG}" = ""; then
|
||||
# go build -v -ldflags "-X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/i386/drone-npm
|
||||
# else
|
||||
# go build -v -ldflags "-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/i386/drone-npm
|
||||
# fi
|
||||
|
||||
# build_linux_arm64:
|
||||
# image: golang:1.9
|
||||
# image: golang:1.10
|
||||
# pull: true
|
||||
# group: build
|
||||
# environment:
|
||||
@@ -30,10 +58,15 @@ pipeline:
|
||||
# - GOARCH=arm64
|
||||
# - CGO_ENABLED=0
|
||||
# commands:
|
||||
# - go build -v -ldflags "-X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/arm64/drone-npm
|
||||
# - |
|
||||
# if test "${DRONE_TAG}" = ""; then
|
||||
# go build -v -ldflags "-X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/arm64/drone-npm
|
||||
# else
|
||||
# go build -v -ldflags "-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/arm64/drone-npm
|
||||
# fi
|
||||
|
||||
# build_linux_arm:
|
||||
# image: golang:1.9
|
||||
# image: golang:1.10
|
||||
# pull: true
|
||||
# group: build
|
||||
# environment:
|
||||
@@ -42,67 +75,74 @@ pipeline:
|
||||
# - CGO_ENABLED=0
|
||||
# - GOARM=7
|
||||
# commands:
|
||||
# - go build -v -ldflags "-X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/arm/drone-npm
|
||||
|
||||
# build_windows_amd64:
|
||||
# image: golang:1.9-nanoserver
|
||||
# pull: true
|
||||
# group: build
|
||||
# environment:
|
||||
# - GOOS=windows
|
||||
# - GOARCH=amd64
|
||||
# - CGO_ENABLED=0
|
||||
# commands:
|
||||
# - go build -v -ldflags "-X main.build=${DRONE_BUILD_NUMBER}" -a -o release/windows/amd64/drone-npm
|
||||
# - |
|
||||
# if test "${DRONE_TAG}" = ""; then
|
||||
# go build -v -ldflags "-X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/arm/drone-npm
|
||||
# else
|
||||
# go build -v -ldflags "-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}" -a -o release/linux/arm/drone-npm
|
||||
# fi
|
||||
|
||||
publish_linux_amd64:
|
||||
image: plugins/docker:17.05
|
||||
image: plugins/docker:17.12
|
||||
pull: true
|
||||
repo: plugins/npm
|
||||
tags: [ latest, 1.0.0, 1.0, 1 ]
|
||||
secrets: [ docker_username, docker_password ]
|
||||
group: docker
|
||||
repo: plugins/npm
|
||||
auto_tag: true
|
||||
auto_tag_suffix: linux-amd64
|
||||
dockerfile: Dockerfile
|
||||
when:
|
||||
branch: master
|
||||
event: push
|
||||
event: [ push, tag ]
|
||||
|
||||
# publish_linux_i386:
|
||||
# image: plugins/docker:17.12
|
||||
# pull: true
|
||||
# secrets: [ docker_username, docker_password ]
|
||||
# group: docker
|
||||
# repo: plugins/npm
|
||||
# auto_tag: true
|
||||
# auto_tag_suffix: linux-i386
|
||||
# dockerfile: Dockerfile.i386
|
||||
# when:
|
||||
# event: [ push, tag ]
|
||||
|
||||
# publish_linux_arm64:
|
||||
# image: plugins/docker:17.05
|
||||
# image: plugins/docker:17.12
|
||||
# pull: true
|
||||
# repo: plugins/npm
|
||||
# tags: [ linux-arm64 ]
|
||||
# secrets: [ docker_username, docker_password ]
|
||||
# group: docker
|
||||
# repo: plugins/npm
|
||||
# auto_tag: true
|
||||
# auto_tag_suffix: linux-arm64
|
||||
# dockerfile: Dockerfile.arm64
|
||||
# when:
|
||||
# branch: master
|
||||
# event: push
|
||||
# event: [ push, tag ]
|
||||
|
||||
# publish_linux_arm:
|
||||
# image: plugins/docker:17.05
|
||||
# image: plugins/docker:17.12
|
||||
# pull: true
|
||||
# repo: plugins/npm
|
||||
# tags: [ linux-arm ]
|
||||
# secrets: [ docker_username, docker_password ]
|
||||
# group: docker
|
||||
# repo: plugins/npm
|
||||
# auto_tag: true
|
||||
# auto_tag_suffix: linux-arm
|
||||
# dockerfile: Dockerfile.arm
|
||||
# when:
|
||||
# branch: master
|
||||
# event: push
|
||||
# event: [ push, tag ]
|
||||
|
||||
# publish_windows_amd64:
|
||||
# image: plugins/docker:17.05
|
||||
# pull: true
|
||||
# repo: plugins/npm
|
||||
# tags: [ windows-amd64 ]
|
||||
# secrets: [ docker_username, docker_password ]
|
||||
# dockerfile: Dockerfile.windows
|
||||
# when:
|
||||
# branch: master
|
||||
# event: push
|
||||
manifests:
|
||||
image: plugins/manifest:1
|
||||
pull: true
|
||||
secrets: [ docker_username, docker_password ]
|
||||
spec: manifest.tmpl
|
||||
auto_tag: true
|
||||
ignore_missing: true
|
||||
when:
|
||||
event: [ push, tag ]
|
||||
|
||||
microbadger:
|
||||
image: plugins/webhook:1
|
||||
pull: true
|
||||
secrets: [ webhook_url ]
|
||||
when:
|
||||
branch: master
|
||||
event: push
|
||||
status: [ success ]
|
||||
|
||||
+3
-2
@@ -22,8 +22,9 @@ _testmain.go
|
||||
*.exe
|
||||
*.test
|
||||
*.prof
|
||||
.env
|
||||
|
||||
release/*
|
||||
release/
|
||||
vendor/
|
||||
|
||||
coverage.out
|
||||
drone-npm
|
||||
|
||||
+6
-8
@@ -1,13 +1,11 @@
|
||||
FROM plugins/base:amd64
|
||||
MAINTAINER Drone.IO Community <drone-dev@googlegroups.com>
|
||||
|
||||
RUN apk add -U --no-cache git nodejs nodejs-npm
|
||||
LABEL maintainer="Drone.IO Community <drone-dev@googlegroups.com>" \
|
||||
org.label-schema.name="Drone NPM" \
|
||||
org.label-schema.vendor="Drone.IO Community" \
|
||||
org.label-schema.schema-version="1.0"
|
||||
|
||||
LABEL org.label-schema.version=latest
|
||||
LABEL org.label-schema.vcs-url="https://github.com/drone-plugins/drone-npm.git"
|
||||
LABEL org.label-schema.name="Drone NPM"
|
||||
LABEL org.label-schema.vendor="Drone.IO Community"
|
||||
LABEL org.label-schema.schema-version="1.0"
|
||||
RUN apk add --no-cache git nodejs nodejs-npm
|
||||
|
||||
ADD release/linux/amd64/drone-npm /bin/
|
||||
ENTRYPOINT [ "/bin/drone-npm" ]
|
||||
ENTRYPOINT ["/bin/drone-npm"]
|
||||
|
||||
+5
-7
@@ -1,13 +1,11 @@
|
||||
FROM plugins/base:arm
|
||||
MAINTAINER Drone.IO Community <drone-dev@googlegroups.com>
|
||||
|
||||
RUN apk add -U --no-cache git nodejs nodejs-npm
|
||||
LABEL maintainer="Drone.IO Community <drone-dev@googlegroups.com>" \
|
||||
org.label-schema.name="Drone NPM" \
|
||||
org.label-schema.vendor="Drone.IO Community" \
|
||||
org.label-schema.schema-version="1.0"
|
||||
|
||||
LABEL org.label-schema.version=latest
|
||||
LABEL org.label-schema.vcs-url="https://github.com/drone-plugins/drone-npm.git"
|
||||
LABEL org.label-schema.name="Drone NPM"
|
||||
LABEL org.label-schema.vendor="Drone.IO Community"
|
||||
LABEL org.label-schema.schema-version="1.0"
|
||||
RUN apk add --no-cache git nodejs nodejs-npm
|
||||
|
||||
ADD release/linux/arm/drone-npm /bin/
|
||||
ENTRYPOINT [ "/bin/drone-npm" ]
|
||||
|
||||
+5
-7
@@ -1,13 +1,11 @@
|
||||
FROM plugins/base:arm64
|
||||
MAINTAINER Drone.IO Community <drone-dev@googlegroups.com>
|
||||
|
||||
RUN apk add -U --no-cache git nodejs nodejs-npm
|
||||
LABEL maintainer="Drone.IO Community <drone-dev@googlegroups.com>" \
|
||||
org.label-schema.name="Drone NPM" \
|
||||
org.label-schema.vendor="Drone.IO Community" \
|
||||
org.label-schema.schema-version="1.0"
|
||||
|
||||
LABEL org.label-schema.version=latest
|
||||
LABEL org.label-schema.vcs-url="https://github.com/drone-plugins/drone-npm.git"
|
||||
LABEL org.label-schema.name="Drone NPM"
|
||||
LABEL org.label-schema.vendor="Drone.IO Community"
|
||||
LABEL org.label-schema.schema-version="1.0"
|
||||
RUN apk add --no-cache git nodejs nodejs-npm
|
||||
|
||||
ADD release/linux/arm64/drone-npm /bin/
|
||||
ENTRYPOINT [ "/bin/drone-npm" ]
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
FROM plugins/base:multiarch
|
||||
|
||||
LABEL maintainer="Drone.IO Community <drone-dev@googlegroups.com>" \
|
||||
org.label-schema.name="Drone NPM" \
|
||||
org.label-schema.vendor="Drone.IO Community" \
|
||||
org.label-schema.schema-version="1.0"
|
||||
|
||||
RUN apk add --no-cache git nodejs nodejs-npm
|
||||
|
||||
ADD release/linux/i386/drone-npm /bin/
|
||||
ENTRYPOINT ["/bin/drone-npm"]
|
||||
+11
-10
@@ -1,13 +1,14 @@
|
||||
FROM microsoft/nanoserver:latest
|
||||
MAINTAINER Drone.IO Community <drone-dev@googlegroups.com>
|
||||
# escape=`
|
||||
FROM microsoft/nanoserver:10.0.14393.1593
|
||||
|
||||
# TODO: install nodejs and git
|
||||
LABEL maintainer="Drone.IO Community <drone-dev@googlegroups.com>" `
|
||||
org.label-schema.name="Drone NPM" `
|
||||
org.label-schema.vendor="Drone.IO Community" `
|
||||
org.label-schema.schema-version="1.0"
|
||||
|
||||
LABEL org.label-schema.version=latest
|
||||
LABEL org.label-schema.vcs-url="https://github.com/drone-plugins/drone-npm.git"
|
||||
LABEL org.label-schema.name="Drone NPM"
|
||||
LABEL org.label-schema.vendor="Drone.IO Community"
|
||||
LABEL org.label-schema.schema-version="1.0"
|
||||
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
|
||||
|
||||
ADD release/windows/amd64/drone-npm /bin/
|
||||
ENTRYPOINT [ "/bin/drone-npm" ]
|
||||
# TODO: install required tools
|
||||
|
||||
ADD release\drone-npm.exe c:\drone-npm.exe
|
||||
ENTRYPOINT [ "c:\\drone-npm.exe" ]
|
||||
|
||||
Generated
+42
@@ -0,0 +1,42 @@
|
||||
# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
|
||||
|
||||
|
||||
[[projects]]
|
||||
name = "github.com/Sirupsen/logrus"
|
||||
packages = ["."]
|
||||
revision = "c155da19408a8799da419ed3eeb0cb5db0ad5dbc"
|
||||
version = "v1.0.5"
|
||||
|
||||
[[projects]]
|
||||
name = "github.com/joho/godotenv"
|
||||
packages = ["."]
|
||||
revision = "a79fa1e548e2c689c241d10173efd51e5d689d5b"
|
||||
version = "v1.2.0"
|
||||
|
||||
[[projects]]
|
||||
name = "github.com/urfave/cli"
|
||||
packages = ["."]
|
||||
revision = "cfb38830724cc34fedffe9a2a29fb54fa9169cd1"
|
||||
version = "v1.20.0"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
name = "golang.org/x/crypto"
|
||||
packages = ["ssh/terminal"]
|
||||
revision = "b4956d363a8b14623cc81db401707679605930a3"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
name = "golang.org/x/sys"
|
||||
packages = [
|
||||
"unix",
|
||||
"windows"
|
||||
]
|
||||
revision = "cc7307a45468e49eaf2997c890f14aa03a26917b"
|
||||
|
||||
[solve-meta]
|
||||
analyzer-name = "dep"
|
||||
analyzer-version = 1
|
||||
inputs-digest = "8c5404e9d94630e04025cdca89c6b63ca5c9f4bb021a3fad2557e571abbb377c"
|
||||
solver-name = "gps-cdcl"
|
||||
solver-version = 1
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
[[constraint]]
|
||||
name = "github.com/Sirupsen/logrus"
|
||||
version = "1.0.5"
|
||||
|
||||
[[constraint]]
|
||||
name = "github.com/joho/godotenv"
|
||||
version = "1.2.0"
|
||||
|
||||
[[constraint]]
|
||||
name = "github.com/urfave/cli"
|
||||
version = "1.20.0"
|
||||
|
||||
[prune]
|
||||
go-tests = true
|
||||
unused-packages = true
|
||||
@@ -0,0 +1,33 @@
|
||||
image: plugins/npm:{{#if build.tag}}{{trimPrefix build.tag "v"}}{{else}}latest{{/if}}
|
||||
{{#if build.tags}}
|
||||
tags:
|
||||
{{#each build.tags}}
|
||||
- {{this}}
|
||||
{{/each}}
|
||||
{{/if}}
|
||||
manifests:
|
||||
-
|
||||
image: plugins/npm:{{#if build.tag}}{{trimPrefix build.tag "v"}}-{{/if}}linux-amd64
|
||||
platform:
|
||||
architecture: amd64
|
||||
os: linux
|
||||
-
|
||||
image: plugins/npm:{{#if build.tag}}{{trimPrefix build.tag "v"}}-{{/if}}linux-i386
|
||||
platform:
|
||||
architecture: 386
|
||||
os: linux
|
||||
-
|
||||
image: plugins/npm:{{#if build.tag}}{{trimPrefix build.tag "v"}}-{{/if}}linux-arm64
|
||||
platform:
|
||||
architecture: arm64
|
||||
os: linux
|
||||
-
|
||||
image: plugins/npm:{{#if build.tag}}{{trimPrefix build.tag "v"}}-{{/if}}linux-arm
|
||||
platform:
|
||||
architecture: arm
|
||||
os: linux
|
||||
-
|
||||
image: plugins/npm:{{#if build.tag}}{{trimPrefix build.tag "v"}}-{{/if}}windows-amd64
|
||||
platform:
|
||||
architecture: amd64
|
||||
os: windows
|
||||
Reference in New Issue
Block a user