From a7a64c8cd5c7700c708044d88d853696c217ec89 Mon Sep 17 00:00:00 2001 From: Thomas Boerger Date: Thu, 14 Feb 2019 20:14:11 +0100 Subject: [PATCH 1/5] Drop renovate config, it is simply too noisy --- renovate.json | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 renovate.json diff --git a/renovate.json b/renovate.json deleted file mode 100644 index 9980624..0000000 --- a/renovate.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "extends": [ - "config:base" - ], - "docker": { - "fileMatch": [ - "/docker/Dockerfile" - ] - }, - "labels": [ - "renovate" - ] -} From 30eaad28391b79ca739a23382f7b8b858aa846ed Mon Sep 17 00:00:00 2001 From: Thomas Boerger Date: Fri, 15 Feb 2019 10:25:21 +0100 Subject: [PATCH 2/5] Add a reliable version --- .drone.windows.yml | 24 ++++++++++---------- .drone.yml | 48 ++++++++++++++++++++-------------------- cmd/drone-docker/main.go | 6 +++-- pipeline.libsonnet | 4 ++-- 4 files changed, 42 insertions(+), 40 deletions(-) diff --git a/.drone.windows.yml b/.drone.windows.yml index 362ff45..af03da1 100644 --- a/.drone.windows.yml +++ b/.drone.windows.yml @@ -54,7 +54,7 @@ steps: pull: always image: golang:1.11-windowsservercore-1803 commands: - - "go build -v -ldflags \"-X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/windows/amd64/drone-docker.exe ./cmd/drone-docker" + - "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/windows/amd64/drone-docker.exe ./cmd/drone-docker" environment: CGO_ENABLED: 0 GO111MODULE: on @@ -67,7 +67,7 @@ steps: pull: always image: golang:1.11-windowsservercore-1803 commands: - - "go build -v -ldflags \"-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/windows/amd64/drone-docker.exe ./cmd/drone-docker" + - "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/windows/amd64/drone-docker.exe ./cmd/drone-docker" environment: CGO_ENABLED: 0 GO111MODULE: on @@ -150,7 +150,7 @@ steps: pull: always image: golang:1.11-windowsservercore-1809 commands: - - "go build -v -ldflags \"-X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/windows/amd64/drone-docker.exe ./cmd/drone-docker" + - "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/windows/amd64/drone-docker.exe ./cmd/drone-docker" environment: CGO_ENABLED: 0 GO111MODULE: on @@ -163,7 +163,7 @@ steps: pull: always image: golang:1.11-windowsservercore-1809 commands: - - "go build -v -ldflags \"-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/windows/amd64/drone-docker.exe ./cmd/drone-docker" + - "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/windows/amd64/drone-docker.exe ./cmd/drone-docker" environment: CGO_ENABLED: 0 GO111MODULE: on @@ -283,7 +283,7 @@ steps: pull: always image: golang:1.11-windowsservercore-1803 commands: - - "go build -v -ldflags \"-X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/windows/amd64/drone-gcr.exe ./cmd/drone-gcr" + - "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/windows/amd64/drone-gcr.exe ./cmd/drone-gcr" environment: CGO_ENABLED: 0 GO111MODULE: on @@ -296,7 +296,7 @@ steps: pull: always image: golang:1.11-windowsservercore-1803 commands: - - "go build -v -ldflags \"-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/windows/amd64/drone-gcr.exe ./cmd/drone-gcr" + - "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/windows/amd64/drone-gcr.exe ./cmd/drone-gcr" environment: CGO_ENABLED: 0 GO111MODULE: on @@ -373,7 +373,7 @@ steps: pull: always image: golang:1.11-windowsservercore-1809 commands: - - "go build -v -ldflags \"-X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/windows/amd64/drone-gcr.exe ./cmd/drone-gcr" + - "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/windows/amd64/drone-gcr.exe ./cmd/drone-gcr" environment: CGO_ENABLED: 0 GO111MODULE: on @@ -386,7 +386,7 @@ steps: pull: always image: golang:1.11-windowsservercore-1809 commands: - - "go build -v -ldflags \"-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/windows/amd64/drone-gcr.exe ./cmd/drone-gcr" + - "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/windows/amd64/drone-gcr.exe ./cmd/drone-gcr" environment: CGO_ENABLED: 0 GO111MODULE: on @@ -500,7 +500,7 @@ steps: pull: always image: golang:1.11-windowsservercore-1803 commands: - - "go build -v -ldflags \"-X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/windows/amd64/drone-ecr.exe ./cmd/drone-ecr" + - "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/windows/amd64/drone-ecr.exe ./cmd/drone-ecr" environment: CGO_ENABLED: 0 GO111MODULE: on @@ -513,7 +513,7 @@ steps: pull: always image: golang:1.11-windowsservercore-1803 commands: - - "go build -v -ldflags \"-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/windows/amd64/drone-ecr.exe ./cmd/drone-ecr" + - "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/windows/amd64/drone-ecr.exe ./cmd/drone-ecr" environment: CGO_ENABLED: 0 GO111MODULE: on @@ -590,7 +590,7 @@ steps: pull: always image: golang:1.11-windowsservercore-1809 commands: - - "go build -v -ldflags \"-X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/windows/amd64/drone-ecr.exe ./cmd/drone-ecr" + - "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/windows/amd64/drone-ecr.exe ./cmd/drone-ecr" environment: CGO_ENABLED: 0 GO111MODULE: on @@ -603,7 +603,7 @@ steps: pull: always image: golang:1.11-windowsservercore-1809 commands: - - "go build -v -ldflags \"-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/windows/amd64/drone-ecr.exe ./cmd/drone-ecr" + - "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/windows/amd64/drone-ecr.exe ./cmd/drone-ecr" environment: CGO_ENABLED: 0 GO111MODULE: on diff --git a/.drone.yml b/.drone.yml index 683c562..0b3027c 100644 --- a/.drone.yml +++ b/.drone.yml @@ -52,7 +52,7 @@ steps: pull: always image: golang:1.11 commands: - - "go build -v -ldflags \"-X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/linux/amd64/drone-docker ./cmd/drone-docker" + - "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/linux/amd64/drone-docker ./cmd/drone-docker" environment: CGO_ENABLED: 0 GO111MODULE: on @@ -65,7 +65,7 @@ steps: pull: always image: golang:1.11 commands: - - "go build -v -ldflags \"-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/linux/amd64/drone-docker ./cmd/drone-docker" + - "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/linux/amd64/drone-docker ./cmd/drone-docker" environment: CGO_ENABLED: 0 GO111MODULE: on @@ -136,7 +136,7 @@ steps: pull: always image: golang:1.11 commands: - - "go build -v -ldflags \"-X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/linux/arm64/drone-docker ./cmd/drone-docker" + - "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/linux/arm64/drone-docker ./cmd/drone-docker" environment: CGO_ENABLED: 0 GO111MODULE: on @@ -149,7 +149,7 @@ steps: pull: always image: golang:1.11 commands: - - "go build -v -ldflags \"-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/linux/arm64/drone-docker ./cmd/drone-docker" + - "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/linux/arm64/drone-docker ./cmd/drone-docker" environment: CGO_ENABLED: 0 GO111MODULE: on @@ -220,7 +220,7 @@ steps: pull: always image: golang:1.11 commands: - - "go build -v -ldflags \"-X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/linux/arm/drone-docker ./cmd/drone-docker" + - "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/linux/arm/drone-docker ./cmd/drone-docker" environment: CGO_ENABLED: 0 GO111MODULE: on @@ -233,7 +233,7 @@ steps: pull: always image: golang:1.11 commands: - - "go build -v -ldflags \"-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/linux/arm/drone-docker ./cmd/drone-docker" + - "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/linux/arm/drone-docker ./cmd/drone-docker" environment: CGO_ENABLED: 0 GO111MODULE: on @@ -341,7 +341,7 @@ steps: pull: always image: golang:1.11 commands: - - "go build -v -ldflags \"-X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/linux/amd64/drone-gcr ./cmd/drone-gcr" + - "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/linux/amd64/drone-gcr ./cmd/drone-gcr" environment: CGO_ENABLED: 0 GO111MODULE: on @@ -354,7 +354,7 @@ steps: pull: always image: golang:1.11 commands: - - "go build -v -ldflags \"-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/linux/amd64/drone-gcr ./cmd/drone-gcr" + - "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/linux/amd64/drone-gcr ./cmd/drone-gcr" environment: CGO_ENABLED: 0 GO111MODULE: on @@ -419,7 +419,7 @@ steps: pull: always image: golang:1.11 commands: - - "go build -v -ldflags \"-X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/linux/arm64/drone-gcr ./cmd/drone-gcr" + - "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/linux/arm64/drone-gcr ./cmd/drone-gcr" environment: CGO_ENABLED: 0 GO111MODULE: on @@ -432,7 +432,7 @@ steps: pull: always image: golang:1.11 commands: - - "go build -v -ldflags \"-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/linux/arm64/drone-gcr ./cmd/drone-gcr" + - "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/linux/arm64/drone-gcr ./cmd/drone-gcr" environment: CGO_ENABLED: 0 GO111MODULE: on @@ -497,7 +497,7 @@ steps: pull: always image: golang:1.11 commands: - - "go build -v -ldflags \"-X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/linux/arm/drone-gcr ./cmd/drone-gcr" + - "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/linux/arm/drone-gcr ./cmd/drone-gcr" environment: CGO_ENABLED: 0 GO111MODULE: on @@ -510,7 +510,7 @@ steps: pull: always image: golang:1.11 commands: - - "go build -v -ldflags \"-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/linux/arm/drone-gcr ./cmd/drone-gcr" + - "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/linux/arm/drone-gcr ./cmd/drone-gcr" environment: CGO_ENABLED: 0 GO111MODULE: on @@ -612,7 +612,7 @@ steps: pull: always image: golang:1.11 commands: - - "go build -v -ldflags \"-X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/linux/amd64/drone-ecr ./cmd/drone-ecr" + - "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/linux/amd64/drone-ecr ./cmd/drone-ecr" environment: CGO_ENABLED: 0 GO111MODULE: on @@ -625,7 +625,7 @@ steps: pull: always image: golang:1.11 commands: - - "go build -v -ldflags \"-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/linux/amd64/drone-ecr ./cmd/drone-ecr" + - "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/linux/amd64/drone-ecr ./cmd/drone-ecr" environment: CGO_ENABLED: 0 GO111MODULE: on @@ -690,7 +690,7 @@ steps: pull: always image: golang:1.11 commands: - - "go build -v -ldflags \"-X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/linux/arm64/drone-ecr ./cmd/drone-ecr" + - "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/linux/arm64/drone-ecr ./cmd/drone-ecr" environment: CGO_ENABLED: 0 GO111MODULE: on @@ -703,7 +703,7 @@ steps: pull: always image: golang:1.11 commands: - - "go build -v -ldflags \"-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/linux/arm64/drone-ecr ./cmd/drone-ecr" + - "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/linux/arm64/drone-ecr ./cmd/drone-ecr" environment: CGO_ENABLED: 0 GO111MODULE: on @@ -768,7 +768,7 @@ steps: pull: always image: golang:1.11 commands: - - "go build -v -ldflags \"-X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/linux/arm/drone-ecr ./cmd/drone-ecr" + - "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/linux/arm/drone-ecr ./cmd/drone-ecr" environment: CGO_ENABLED: 0 GO111MODULE: on @@ -781,7 +781,7 @@ steps: pull: always image: golang:1.11 commands: - - "go build -v -ldflags \"-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/linux/arm/drone-ecr ./cmd/drone-ecr" + - "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/linux/arm/drone-ecr ./cmd/drone-ecr" environment: CGO_ENABLED: 0 GO111MODULE: on @@ -883,7 +883,7 @@ steps: pull: always image: golang:1.11 commands: - - "go build -v -ldflags \"-X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/linux/amd64/drone-heroku ./cmd/drone-heroku" + - "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/linux/amd64/drone-heroku ./cmd/drone-heroku" environment: CGO_ENABLED: 0 GO111MODULE: on @@ -896,7 +896,7 @@ steps: pull: always image: golang:1.11 commands: - - "go build -v -ldflags \"-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/linux/amd64/drone-heroku ./cmd/drone-heroku" + - "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/linux/amd64/drone-heroku ./cmd/drone-heroku" environment: CGO_ENABLED: 0 GO111MODULE: on @@ -961,7 +961,7 @@ steps: pull: always image: golang:1.11 commands: - - "go build -v -ldflags \"-X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/linux/arm64/drone-heroku ./cmd/drone-heroku" + - "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/linux/arm64/drone-heroku ./cmd/drone-heroku" environment: CGO_ENABLED: 0 GO111MODULE: on @@ -974,7 +974,7 @@ steps: pull: always image: golang:1.11 commands: - - "go build -v -ldflags \"-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/linux/arm64/drone-heroku ./cmd/drone-heroku" + - "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/linux/arm64/drone-heroku ./cmd/drone-heroku" environment: CGO_ENABLED: 0 GO111MODULE: on @@ -1039,7 +1039,7 @@ steps: pull: always image: golang:1.11 commands: - - "go build -v -ldflags \"-X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/linux/arm/drone-heroku ./cmd/drone-heroku" + - "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/linux/arm/drone-heroku ./cmd/drone-heroku" environment: CGO_ENABLED: 0 GO111MODULE: on @@ -1052,7 +1052,7 @@ steps: pull: always image: golang:1.11 commands: - - "go build -v -ldflags \"-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/linux/arm/drone-heroku ./cmd/drone-heroku" + - "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/linux/arm/drone-heroku ./cmd/drone-heroku" environment: CGO_ENABLED: 0 GO111MODULE: on diff --git a/cmd/drone-docker/main.go b/cmd/drone-docker/main.go index 145997b..13b76e0 100644 --- a/cmd/drone-docker/main.go +++ b/cmd/drone-docker/main.go @@ -11,7 +11,9 @@ import ( "github.com/drone-plugins/drone-docker" ) -var build = "0" // build number set at compile-time +var ( + version = "unknown" +) func main() { // Load env-file if it exists first @@ -23,7 +25,7 @@ func main() { app.Name = "docker plugin" app.Usage = "docker plugin" app.Action = run - app.Version = fmt.Sprintf("1.0.%s", build) + app.Version = version app.Flags = []cli.Flag{ cli.BoolFlag{ Name: "dry-run", diff --git a/pipeline.libsonnet b/pipeline.libsonnet index 92fee9e..5f1085d 100644 --- a/pipeline.libsonnet +++ b/pipeline.libsonnet @@ -83,7 +83,7 @@ local golang_image(os, version) = GO111MODULE: 'on', }, commands: [ - 'go build -v -ldflags "-X main.build=${DRONE_BUILD_NUMBER}" -a -tags netgo -o release/' + os + '/' + arch + '/drone-' + name + extension + ' ./cmd/drone-' + name, + 'go build -v -ldflags "-X main.version=${DRONE_COMMIT_SHA:0:8}" -a -tags netgo -o release/' + os + '/' + arch + '/drone-' + name + extension + ' ./cmd/drone-' + name, ], when: { event: { @@ -100,7 +100,7 @@ local golang_image(os, version) = GO111MODULE: 'on', }, commands: [ - 'go build -v -ldflags "-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}" -a -tags netgo -o release/' + os + '/' + arch + '/drone-' + name + extension + ' ./cmd/drone-' + name, + 'go build -v -ldflags "-X main.version=${DRONE_TAG##v}" -a -tags netgo -o release/' + os + '/' + arch + '/drone-' + name + extension + ' ./cmd/drone-' + name, ], when: { event: ['tag'], From 6c6e5e3e6e9eee3c8ed060168425479193412004 Mon Sep 17 00:00:00 2001 From: Thomas Boerger Date: Fri, 15 Feb 2019 11:58:33 +0100 Subject: [PATCH 3/5] Unified documentation and readme --- README.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index b4bd438..fc6ebd6 100644 --- a/README.md +++ b/README.md @@ -14,14 +14,12 @@ Drone plugin to build and publish Docker images to a container registry. For the Build the binaries with the following commands: -``` +```console export GOOS=linux export GOARCH=amd64 export CGO_ENABLED=0 export GO111MODULE=on -go test -cover ./... - go build -v -a -tags netgo -o release/linux/amd64/drone-docker ./cmd/drone-docker go build -v -a -tags netgo -o release/linux/amd64/drone-gcr ./cmd/drone-gcr go build -v -a -tags netgo -o release/linux/amd64/drone-ecr ./cmd/drone-ecr @@ -32,7 +30,7 @@ go build -v -a -tags netgo -o release/linux/amd64/drone-heroku ./cmd/drone-herok Build the Docker images with the following commands: -``` +```console docker build \ --label org.label-schema.build-date=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \ --label org.label-schema.vcs-ref=$(git rev-parse --short HEAD) \ @@ -56,9 +54,9 @@ docker build \ ## Usage -Execute from the working directory: +> Notice: Be aware that the Docker plugin currently requires privileged capabilities, otherwise the integrated Docker daemon is not able to start. -``` +```console docker run --rm \ -e PLUGIN_TAG=latest \ -e PLUGIN_REPO=octocat/hello-world \ From 57bf8d747770ecbb7d41f8bb7b37c3ae5cea39c0 Mon Sep 17 00:00:00 2001 From: Thomas Boerger Date: Mon, 18 Feb 2019 23:47:38 +0100 Subject: [PATCH 4/5] Drop import of unused fmt package --- cmd/drone-docker/main.go | 1 - 1 file changed, 1 deletion(-) diff --git a/cmd/drone-docker/main.go b/cmd/drone-docker/main.go index 13b76e0..712ace4 100644 --- a/cmd/drone-docker/main.go +++ b/cmd/drone-docker/main.go @@ -1,7 +1,6 @@ package main import ( - "fmt" "os" "github.com/joho/godotenv" From d394a95230454292a4f9c7b25b2429213ef36542 Mon Sep 17 00:00:00 2001 From: Thomas Boerger Date: Mon, 25 Feb 2019 22:19:42 +0100 Subject: [PATCH 5/5] Fix manifest template helper --- docker/docker/manifest.tmpl | 12 ++++++------ docker/ecr/manifest.tmpl | 12 ++++++------ docker/gcr/manifest.tmpl | 12 ++++++------ docker/heroku/manifest.tmpl | 8 ++++---- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/docker/docker/manifest.tmpl b/docker/docker/manifest.tmpl index d03db6c..8a823f9 100644 --- a/docker/docker/manifest.tmpl +++ b/docker/docker/manifest.tmpl @@ -1,4 +1,4 @@ -image: plugins/docker:{{#if build.tag}}{{trimPrefix build.tag "v"}}{{else}}latest{{/if}} +image: plugins/docker:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}latest{{/if}} {{#if build.tags}} tags: {{#each build.tags}} @@ -7,30 +7,30 @@ tags: {{/if}} manifests: - - image: plugins/docker:{{#if build.tag}}{{trimPrefix build.tag "v"}}-{{/if}}linux-amd64 + image: plugins/docker:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-amd64 platform: architecture: amd64 os: linux - - image: plugins/docker:{{#if build.tag}}{{trimPrefix build.tag "v"}}-{{/if}}linux-arm64 + image: plugins/docker:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-arm64 platform: architecture: arm64 os: linux variant: v8 - - image: plugins/docker:{{#if build.tag}}{{trimPrefix build.tag "v"}}-{{/if}}linux-arm + image: plugins/docker:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-arm platform: architecture: arm os: linux variant: v7 - - image: plugins/docker:{{#if build.tag}}{{trimPrefix build.tag "v"}}-{{/if}}windows-1803 + image: plugins/docker:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}windows-1803 platform: architecture: amd64 os: windows version: 1803 - - image: plugins/docker:{{#if build.tag}}{{trimPrefix build.tag "v"}}-{{/if}}windows-1809 + image: plugins/docker:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}windows-1809 platform: architecture: amd64 os: windows diff --git a/docker/ecr/manifest.tmpl b/docker/ecr/manifest.tmpl index 74654eb..8af16c7 100644 --- a/docker/ecr/manifest.tmpl +++ b/docker/ecr/manifest.tmpl @@ -1,4 +1,4 @@ -image: plugins/ecr:{{#if build.tag}}{{trimPrefix build.tag "v"}}{{else}}latest{{/if}} +image: plugins/ecr:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}latest{{/if}} {{#if build.tags}} tags: {{#each build.tags}} @@ -7,30 +7,30 @@ tags: {{/if}} manifests: - - image: plugins/ecr:{{#if build.tag}}{{trimPrefix build.tag "v"}}-{{/if}}linux-amd64 + image: plugins/ecr:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-amd64 platform: architecture: amd64 os: linux - - image: plugins/ecr:{{#if build.tag}}{{trimPrefix build.tag "v"}}-{{/if}}linux-arm64 + image: plugins/ecr:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-arm64 platform: architecture: arm64 os: linux variant: v8 - - image: plugins/ecr:{{#if build.tag}}{{trimPrefix build.tag "v"}}-{{/if}}linux-arm + image: plugins/ecr:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-arm platform: architecture: arm os: linux variant: v7 - - image: plugins/ecr:{{#if build.tag}}{{trimPrefix build.tag "v"}}-{{/if}}windows-1803 + image: plugins/ecr:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}windows-1803 platform: architecture: amd64 os: windows version: 1803 - - image: plugins/ecr:{{#if build.tag}}{{trimPrefix build.tag "v"}}-{{/if}}windows-1809 + image: plugins/ecr:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}windows-1809 platform: architecture: amd64 os: windows diff --git a/docker/gcr/manifest.tmpl b/docker/gcr/manifest.tmpl index 35c56fa..8b9231a 100644 --- a/docker/gcr/manifest.tmpl +++ b/docker/gcr/manifest.tmpl @@ -1,4 +1,4 @@ -image: plugins/gcr:{{#if build.tag}}{{trimPrefix build.tag "v"}}{{else}}latest{{/if}} +image: plugins/gcr:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}latest{{/if}} {{#if build.tags}} tags: {{#each build.tags}} @@ -7,30 +7,30 @@ tags: {{/if}} manifests: - - image: plugins/gcr:{{#if build.tag}}{{trimPrefix build.tag "v"}}-{{/if}}linux-amd64 + image: plugins/gcr:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-amd64 platform: architecture: amd64 os: linux - - image: plugins/gcr:{{#if build.tag}}{{trimPrefix build.tag "v"}}-{{/if}}linux-arm64 + image: plugins/gcr:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-arm64 platform: architecture: arm64 os: linux variant: v8 - - image: plugins/gcr:{{#if build.tag}}{{trimPrefix build.tag "v"}}-{{/if}}linux-arm + image: plugins/gcr:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-arm platform: architecture: arm os: linux variant: v7 - - image: plugins/gcr:{{#if build.tag}}{{trimPrefix build.tag "v"}}-{{/if}}windows-1803 + image: plugins/gcr:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}windows-1803 platform: architecture: amd64 os: windows version: 1803 - - image: plugins/gcr:{{#if build.tag}}{{trimPrefix build.tag "v"}}-{{/if}}windows-1809 + image: plugins/gcr:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}windows-1809 platform: architecture: amd64 os: windows diff --git a/docker/heroku/manifest.tmpl b/docker/heroku/manifest.tmpl index 1c2315c..28ed9a5 100644 --- a/docker/heroku/manifest.tmpl +++ b/docker/heroku/manifest.tmpl @@ -1,4 +1,4 @@ -image: plugins/heroku:{{#if build.tag}}{{trimPrefix build.tag "v"}}{{else}}latest{{/if}} +image: plugins/heroku:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}latest{{/if}} {{#if build.tags}} tags: {{#each build.tags}} @@ -7,18 +7,18 @@ tags: {{/if}} manifests: - - image: plugins/heroku:{{#if build.tag}}{{trimPrefix build.tag "v"}}-{{/if}}linux-amd64 + image: plugins/heroku:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-amd64 platform: architecture: amd64 os: linux - - image: plugins/heroku:{{#if build.tag}}{{trimPrefix build.tag "v"}}-{{/if}}linux-arm64 + image: plugins/heroku:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-arm64 platform: architecture: arm64 os: linux variant: v8 - - image: plugins/heroku:{{#if build.tag}}{{trimPrefix build.tag "v"}}-{{/if}}linux-arm + image: plugins/heroku:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-arm platform: architecture: arm os: linux