From 9b86cebd986193e079c2ffaef8e90db8fb2d4cc9 Mon Sep 17 00:00:00 2001 From: Thomas Boerger Date: Sun, 20 Jan 2019 22:21:24 +0100 Subject: [PATCH 01/16] Add manifest template to docker folder --- docker/docker/manifest.tmpl | 25 +++++++++++++++++++++++++ docker/ecr/manifest.tmpl | 25 +++++++++++++++++++++++++ docker/gcr/manifest.tmpl | 25 +++++++++++++++++++++++++ docker/heroku/manifest.tmpl | 25 +++++++++++++++++++++++++ 4 files changed, 100 insertions(+) create mode 100644 docker/docker/manifest.tmpl create mode 100644 docker/ecr/manifest.tmpl create mode 100644 docker/gcr/manifest.tmpl create mode 100644 docker/heroku/manifest.tmpl diff --git a/docker/docker/manifest.tmpl b/docker/docker/manifest.tmpl new file mode 100644 index 0000000..5b399aa --- /dev/null +++ b/docker/docker/manifest.tmpl @@ -0,0 +1,25 @@ +image: plugins/docker:{{#if build.tag}}{{trimPrefix build.tag "v"}}{{else}}latest{{/if}} +{{#if build.tags}} +tags: +{{#each build.tags}} + - {{this}} +{{/each}} +{{/if}} +manifests: + - + image: plugins/docker:{{#if build.tag}}{{trimPrefix build.tag "v"}}-{{/if}}linux-amd64 + platform: + architecture: amd64 + os: linux + - + image: plugins/docker:{{#if build.tag}}{{trimPrefix build.tag "v"}}-{{/if}}linux-arm64 + platform: + architecture: arm64 + os: linux + variant: v8 + - + image: plugins/docker:{{#if build.tag}}{{trimPrefix build.tag "v"}}-{{/if}}linux-arm + platform: + architecture: arm + os: linux + variant: v7 diff --git a/docker/ecr/manifest.tmpl b/docker/ecr/manifest.tmpl new file mode 100644 index 0000000..424295f --- /dev/null +++ b/docker/ecr/manifest.tmpl @@ -0,0 +1,25 @@ +image: plugins/ecr:{{#if build.tag}}{{trimPrefix build.tag "v"}}{{else}}latest{{/if}} +{{#if build.tags}} +tags: +{{#each build.tags}} + - {{this}} +{{/each}} +{{/if}} +manifests: + - + image: plugins/ecr:{{#if build.tag}}{{trimPrefix build.tag "v"}}-{{/if}}linux-amd64 + platform: + architecture: amd64 + os: linux + - + image: plugins/ecr:{{#if build.tag}}{{trimPrefix build.tag "v"}}-{{/if}}linux-arm64 + platform: + architecture: arm64 + os: linux + variant: v8 + - + image: plugins/ecr:{{#if build.tag}}{{trimPrefix build.tag "v"}}-{{/if}}linux-arm + platform: + architecture: arm + os: linux + variant: v7 diff --git a/docker/gcr/manifest.tmpl b/docker/gcr/manifest.tmpl new file mode 100644 index 0000000..82f8dae --- /dev/null +++ b/docker/gcr/manifest.tmpl @@ -0,0 +1,25 @@ +image: plugins/gcr:{{#if build.tag}}{{trimPrefix build.tag "v"}}{{else}}latest{{/if}} +{{#if build.tags}} +tags: +{{#each build.tags}} + - {{this}} +{{/each}} +{{/if}} +manifests: + - + image: plugins/gcr:{{#if build.tag}}{{trimPrefix build.tag "v"}}-{{/if}}linux-amd64 + platform: + architecture: amd64 + os: linux + - + image: plugins/gcr:{{#if build.tag}}{{trimPrefix build.tag "v"}}-{{/if}}linux-arm64 + platform: + architecture: arm64 + os: linux + variant: v8 + - + image: plugins/gcr:{{#if build.tag}}{{trimPrefix build.tag "v"}}-{{/if}}linux-arm + platform: + architecture: arm + os: linux + variant: v7 diff --git a/docker/heroku/manifest.tmpl b/docker/heroku/manifest.tmpl new file mode 100644 index 0000000..1c2315c --- /dev/null +++ b/docker/heroku/manifest.tmpl @@ -0,0 +1,25 @@ +image: plugins/heroku:{{#if build.tag}}{{trimPrefix build.tag "v"}}{{else}}latest{{/if}} +{{#if build.tags}} +tags: +{{#each build.tags}} + - {{this}} +{{/each}} +{{/if}} +manifests: + - + image: plugins/heroku:{{#if build.tag}}{{trimPrefix build.tag "v"}}-{{/if}}linux-amd64 + platform: + architecture: amd64 + os: linux + - + image: plugins/heroku:{{#if build.tag}}{{trimPrefix build.tag "v"}}-{{/if}}linux-arm64 + platform: + architecture: arm64 + os: linux + variant: v8 + - + image: plugins/heroku:{{#if build.tag}}{{trimPrefix build.tag "v"}}-{{/if}}linux-arm + platform: + architecture: arm + os: linux + variant: v7 From bb94127aa6d52180b3e13139d3e0e9825f2e3ee5 Mon Sep 17 00:00:00 2001 From: Thomas Boerger Date: Sun, 20 Jan 2019 23:51:59 +0100 Subject: [PATCH 02/16] Migrate configs to drone 1.0.0 and drop appveyor --- .drone.jsonnet | 404 ++++++++++++++++++++ .drone.sh | 24 -- .drone.windows.yml | 244 ++++++++++++ .drone.yml | 902 ++++++++++++++++++++++++++++++++++++++++++--- 4 files changed, 1506 insertions(+), 68 deletions(-) create mode 100644 .drone.jsonnet delete mode 100644 .drone.sh create mode 100644 .drone.windows.yml diff --git a/.drone.jsonnet b/.drone.jsonnet new file mode 100644 index 0000000..537f831 --- /dev/null +++ b/.drone.jsonnet @@ -0,0 +1,404 @@ +local PipelineTesting = { + kind: "pipeline", + name: "testing", + platform: { + os: "linux", + arch: "amd64", + }, + steps: [ + { + name: "vet", + image: "golang:1.11", + pull: "always", + environment: { + GO111MODULE: "on", + }, + commands: [ + "go vet ./...", + ], + }, + { + name: "test", + image: "golang:1.11", + pull: "always", + environment: { + GO111MODULE: "on", + }, + commands: [ + "go test -cover ./...", + ], + }, + ], + trigger: { + branch: [ "master" ], + }, +}; + +local PipelineBuild(os="linux", arch="amd64") = { + kind: "pipeline", + name: os + "-" + arch, + platform: { + os: os, + arch: arch, + }, + steps: [ + { + name: "build-docker", + image: "golang:1.11", + pull: "always", + environment: { + CGO_ENABLED: "0", + GO111MODULE: "on", + }, + commands: [ + "go build -v -ldflags \"-X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/" + os + "/" + arch + "/drone-docker ./cmd/drone-docker", + ], + when: { + event: [ "push", "pull_request" ], + }, + }, + { + name: "build-docker", + image: "golang:1.11", + pull: "always", + environment: { + CGO_ENABLED: "0", + 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-docker ./cmd/drone-docker", + ], + when: { + event: [ "tag" ], + }, + }, + { + name: "dryrun-docker", + image: "plugins/docker:" + os + "-" + arch, + pull: "always", + settings: { + dry_run: true, + tags: os + "-" + arch, + dockerfile: "docker/docker/Dockerfile." + os + "." + arch, + repo: "plugins/docker", + username: { "from_secret": "docker_username" }, + password: { "from_secret": "docker_password" }, + }, + when: { + event: [ "pull_request" ], + }, + }, + { + name: "publish-docker", + image: "plugins/docker:" + os + "-" + arch, + pull: "always", + settings: { + auto_tag: true, + auto_tag_suffix: os + "-" + arch, + dockerfile: "docker/docker/Dockerfile." + os + "." + arch, + repo: "plugins/docker", + username: { "from_secret": "docker_username" }, + password: { "from_secret": "docker_password" }, + }, + when: { + event: [ "push", "tag" ], + }, + }, + { + name: "build-heroku", + image: "golang:1.11", + pull: "always", + environment: { + CGO_ENABLED: "0", + GO111MODULE: "on", + }, + commands: [ + "go build -v -ldflags \"-X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/" + os + "/" + arch + "/drone-heroku ./cmd/drone-heroku", + ], + when: { + event: [ "push", "pull_request" ], + }, + }, + { + name: "build-heroku", + image: "golang:1.11", + pull: "always", + environment: { + CGO_ENABLED: "0", + 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-heroku ./cmd/drone-heroku", + ], + when: { + event: [ "tag" ], + }, + }, + { + name: "dryrun-heroku", + image: "plugins/docker:" + os + "-" + arch, + pull: "always", + settings: { + dry_run: true, + tags: os + "-" + arch, + herokufile: "docker/heroku/Dockerfile." + os + "." + arch, + repo: "plugins/heroku", + username: { "from_secret": "heroku_username" }, + password: { "from_secret": "heroku_password" }, + }, + when: { + event: [ "pull_request" ], + }, + }, + { + name: "publish-heroku", + image: "plugins/docker:" + os + "-" + arch, + pull: "always", + settings: { + auto_tag: true, + auto_tag_suffix: os + "-" + arch, + herokufile: "docker/heroku/Dockerfile." + os + "." + arch, + repo: "plugins/heroku", + username: { "from_secret": "heroku_username" }, + password: { "from_secret": "heroku_password" }, + }, + when: { + event: [ "push", "tag" ], + }, + }, + { + name: "build-gcr", + image: "golang:1.11", + pull: "always", + environment: { + CGO_ENABLED: "0", + GO111MODULE: "on", + }, + commands: [ + "go build -v -ldflags \"-X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/" + os + "/" + arch + "/drone-gcr ./cmd/drone-gcr", + ], + when: { + event: [ "push", "pull_request" ], + }, + }, + { + name: "build-gcr", + image: "golang:1.11", + pull: "always", + environment: { + CGO_ENABLED: "0", + 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-gcr ./cmd/drone-gcr", + ], + when: { + event: [ "tag" ], + }, + }, + { + name: "dryrun-gcr", + image: "plugins/docker:" + os + "-" + arch, + pull: "always", + settings: { + dry_run: true, + tags: os + "-" + arch, + gcrfile: "docker/gcr/Dockerfile." + os + "." + arch, + repo: "plugins/gcr", + username: { "from_secret": "gcr_username" }, + password: { "from_secret": "gcr_password" }, + }, + when: { + event: [ "pull_request" ], + }, + }, + { + name: "publish-gcr", + image: "plugins/docker:" + os + "-" + arch, + pull: "always", + settings: { + auto_tag: true, + auto_tag_suffix: os + "-" + arch, + gcrfile: "docker/gcr/Dockerfile." + os + "." + arch, + repo: "plugins/gcr", + username: { "from_secret": "gcr_username" }, + password: { "from_secret": "gcr_password" }, + }, + when: { + event: [ "push", "tag" ], + }, + }, + { + name: "build-ecr", + image: "golang:1.11", + pull: "always", + environment: { + CGO_ENABLED: "0", + GO111MODULE: "on", + }, + commands: [ + "go build -v -ldflags \"-X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/" + os + "/" + arch + "/drone-ecr ./cmd/drone-ecr", + ], + when: { + event: [ "push", "pull_request" ], + }, + }, + { + name: "build-ecr", + image: "golang:1.11", + pull: "always", + environment: { + CGO_ENABLED: "0", + 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-ecr ./cmd/drone-ecr", + ], + when: { + event: [ "tag" ], + }, + }, + { + name: "dryrun-ecr", + image: "plugins/docker:" + os + "-" + arch, + pull: "always", + settings: { + dry_run: true, + tags: os + "-" + arch, + dockerfile: "docker/ecr/Dockerfile." + os + "." + arch, + repo: "plugins/ecr", + username: { "from_secret": "ecr_username" }, + password: { "from_secret": "ecr_password" }, + }, + when: { + event: [ "pull_request" ], + }, + }, + { + name: "publish-ecr", + image: "plugins/docker:" + os + "-" + arch, + pull: "always", + settings: { + auto_tag: true, + auto_tag_suffix: os + "-" + arch, + dockerfile: "docker/ecr/Dockerfile." + os + "." + arch, + repo: "plugins/ecr", + username: { "from_secret": "ecr_username" }, + password: { "from_secret": "ecr_password" }, + }, + when: { + event: [ "push", "tag" ], + }, + }, + ], + depends_on: [ + "testing", + ], + trigger: { + branch: [ "master" ], + }, +}; + +local PipelineNotifications = { + kind: "pipeline", + name: "notifications", + platform: { + os: "linux", + arch: "amd64", + }, + steps: [ + { + name: "manifest-docker", + image: "plugins/manifest:1", + pull: "always", + settings: { + username: { "from_secret": "docker_username" }, + password: { "from_secret": "docker_password" }, + spec: "docker/docker/manifest.tmpl", + ignore_missing: true, + }, + }, + { + name: "microbadger-docker", + image: "plugins/webhook:1", + pull: "always", + settings: { + url: { "from_secret": "microbadger_docker" }, + }, + }, + { + name: "manifest-heroku", + image: "plugins/manifest:1", + pull: "always", + settings: { + username: { "from_secret": "heroku_username" }, + password: { "from_secret": "heroku_password" }, + spec: "docker/heroku/manifest.tmpl", + ignore_missing: true, + }, + }, + { + name: "microbadger-heroku", + image: "plugins/webhook:1", + pull: "always", + settings: { + url: { "from_secret": "microbadger_heroku" }, + }, + }, + { + name: "manifest-gcr", + image: "plugins/manifest:1", + pull: "always", + settings: { + username: { "from_secret": "gcr_username" }, + password: { "from_secret": "gcr_password" }, + spec: "docker/gcr/manifest.tmpl", + ignore_missing: true, + }, + }, + { + name: "microbadger-gcr", + image: "plugins/webhook:1", + pull: "always", + settings: { + url: { "from_secret": "microbadger_gcr" }, + }, + }, + { + name: "manifest-ecr", + image: "plugins/manifest:1", + pull: "always", + settings: { + username: { "from_secret": "ecr_username" }, + password: { "from_secret": "ecr_password" }, + spec: "docker/ecr/manifest.tmpl", + ignore_missing: true, + }, + }, + { + name: "microbadger-ecr", + image: "plugins/webhook:1", + pull: "always", + settings: { + url: { "from_secret": "microbadger_ecr" }, + }, + }, + ], + depends_on: [ + "linux-amd64", + "linux-arm64", + "linux-arm", + ], + trigger: { + branch: [ "master" ], + event: [ "push", "tag" ], + }, +}; + +[ + PipelineTesting, + PipelineBuild("linux", "amd64"), + PipelineBuild("linux", "arm64"), + PipelineBuild("linux", "arm"), + PipelineNotifications, +] diff --git a/.drone.sh b/.drone.sh deleted file mode 100644 index a86a192..0000000 --- a/.drone.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh - -set -e -set -x - -# compile the main binary -GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags "-X main.build=${DRONE_BUILD_NUMBER}" -a -tags netgo -o release/linux/amd64/drone-docker github.com/drone-plugins/drone-docker/cmd/drone-docker -GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build -ldflags "-X main.build=${DRONE_BUILD_NUMBER}" -a -tags netgo -o release/linux/arm64/drone-docker github.com/drone-plugins/drone-docker/cmd/drone-docker -GOOS=linux GOARCH=arm CGO_ENABLED=0 GOARM=7 go build -ldflags "-X main.build=${DRONE_BUILD_NUMBER}" -a -tags netgo -o release/linux/arm/drone-docker github.com/drone-plugins/drone-docker/cmd/drone-docker - -# build the heroku binary -GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -a -tags netgo -o release/linux/amd64/drone-docker-heroku github.com/drone-plugins/drone-docker/cmd/drone-docker-heroku -GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build -a -tags netgo -o release/linux/arm64/drone-docker-heroku github.com/drone-plugins/drone-docker/cmd/drone-docker-heroku -GOOS=linux GOARCH=arm CGO_ENABLED=0 GOARM=7 go build -a -tags netgo -o release/linux/arm/drone-docker-heroku github.com/drone-plugins/drone-docker/cmd/drone-docker-heroku - -# build the gcr binary -GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -a -tags netgo -o release/linux/amd64/drone-docker-gcr github.com/drone-plugins/drone-docker/cmd/drone-docker-gcr -GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build -a -tags netgo -o release/linux/arm64/drone-docker-gcr github.com/drone-plugins/drone-docker/cmd/drone-docker-gcr -GOOS=linux GOARCH=arm CGO_ENABLED=0 GOARM=7 go build -a -tags netgo -o release/linux/arm/drone-docker-gcr github.com/drone-plugins/drone-docker/cmd/drone-docker-gcr - -# build the ecr binary -GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -a -tags netgo -o release/linux/amd64/drone-docker-ecr github.com/drone-plugins/drone-docker/cmd/drone-docker-ecr -GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build -a -tags netgo -o release/linux/arm64/drone-docker-ecr github.com/drone-plugins/drone-docker/cmd/drone-docker-ecr -GOOS=linux GOARCH=arm CGO_ENABLED=0 GOARM=7 go build -a -tags netgo -o release/linux/arm/drone-docker-ecr github.com/drone-plugins/drone-docker/cmd/drone-docker-ecr diff --git a/.drone.windows.yml b/.drone.windows.yml new file mode 100644 index 0000000..ec704cc --- /dev/null +++ b/.drone.windows.yml @@ -0,0 +1,244 @@ +--- +kind: pipeline +name: linux-amd64 + +platform: + os: linux + arch: amd64 + +steps: +- name: build-docker + 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" + environment: + CGO_ENABLED: 0 + GO111MODULE: on + when: + event: + - push + - pull_request + +- name: build-docker + 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" + environment: + CGO_ENABLED: 0 + GO111MODULE: on + when: + event: + - tag + +- name: dryrun-docker + pull: always + image: plugins/docker:linux-amd64 + settings: + dockerfile: docker/docker/Dockerfile.linux.amd64 + dry_run: true + password: + from_secret: docker_password + repo: plugins/docker + tags: linux-amd64 + username: + from_secret: docker_username + when: + event: + - pull_request + +- name: publish-docker + pull: always + image: plugins/docker:linux-amd64 + settings: + auto_tag: true + auto_tag_suffix: linux-amd64 + dockerfile: docker/docker/Dockerfile.linux.amd64 + password: + from_secret: docker_password + repo: plugins/docker + username: + from_secret: docker_username + when: + event: + - push + - tag + +- name: build-heroku + 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" + environment: + CGO_ENABLED: 0 + GO111MODULE: on + when: + event: + - push + - pull_request + +- name: build-heroku + 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" + environment: + CGO_ENABLED: 0 + GO111MODULE: on + when: + event: + - tag + +- name: dryrun-heroku + pull: always + image: plugins/docker:linux-amd64 + settings: + dry_run: true + herokufile: docker/heroku/Dockerfile.linux.amd64 + password: + from_secret: heroku_password + repo: plugins/heroku + tags: linux-amd64 + username: + from_secret: heroku_username + when: + event: + - pull_request + +- name: publish-heroku + pull: always + image: plugins/docker:linux-amd64 + settings: + auto_tag: true + auto_tag_suffix: linux-amd64 + herokufile: docker/heroku/Dockerfile.linux.amd64 + password: + from_secret: heroku_password + repo: plugins/heroku + username: + from_secret: heroku_username + when: + event: + - push + - tag + +- name: build-gcr + 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" + environment: + CGO_ENABLED: 0 + GO111MODULE: on + when: + event: + - push + - pull_request + +- name: build-gcr + 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" + environment: + CGO_ENABLED: 0 + GO111MODULE: on + when: + event: + - tag + +- name: dryrun-gcr + pull: always + image: plugins/docker:linux-amd64 + settings: + dry_run: true + gcrfile: docker/gcr/Dockerfile.linux.amd64 + password: + from_secret: gcr_password + repo: plugins/gcr + tags: linux-amd64 + username: + from_secret: gcr_username + when: + event: + - pull_request + +- name: publish-gcr + pull: always + image: plugins/docker:linux-amd64 + settings: + auto_tag: true + auto_tag_suffix: linux-amd64 + gcrfile: docker/gcr/Dockerfile.linux.amd64 + password: + from_secret: gcr_password + repo: plugins/gcr + username: + from_secret: gcr_username + when: + event: + - push + - tag + +- name: build-ecr + 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" + environment: + CGO_ENABLED: 0 + GO111MODULE: on + when: + event: + - push + - pull_request + +- name: build-ecr + 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" + environment: + CGO_ENABLED: 0 + GO111MODULE: on + when: + event: + - tag + +- name: dryrun-ecr + pull: always + image: plugins/docker:linux-amd64 + settings: + dockerfile: docker/ecr/Dockerfile.linux.amd64 + dry_run: true + password: + from_secret: ecr_password + repo: plugins/ecr + tags: linux-amd64 + username: + from_secret: ecr_username + when: + event: + - pull_request + +- name: publish-ecr + pull: always + image: plugins/docker:linux-amd64 + settings: + auto_tag: true + auto_tag_suffix: linux-amd64 + dockerfile: docker/ecr/Dockerfile.linux.amd64 + password: + from_secret: ecr_password + repo: plugins/ecr + username: + from_secret: ecr_username + when: + event: + - push + - tag + +trigger: + branch: + - master diff --git a/.drone.yml b/.drone.yml index 0fc3103..319db3a 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,53 +1,867 @@ -workspace: - base: /go - path: src/github.com/drone-plugins/drone-docker +--- +kind: pipeline +name: testing -pipeline: - build: - image: golang:1.9 - commands: - - go get -u github.com/golang/dep/cmd/dep - - dep ensure - - go vet ./... - - go test -cover ./... - - sh .drone.sh +platform: + os: linux + arch: amd64 - publish: - image: plugins/docker +steps: +- name: vet + pull: always + image: golang:1.11 + commands: + - go vet ./... + environment: + GO111MODULE: on + +- name: test + pull: always + image: golang:1.11 + commands: + - go test -cover ./... + environment: + GO111MODULE: on + +trigger: + branch: + - master + +--- +kind: pipeline +name: linux-amd64 + +platform: + os: linux + arch: amd64 + +steps: +- name: build-docker + 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" + environment: + CGO_ENABLED: 0 + GO111MODULE: on + when: + event: + - push + - pull_request + +- name: build-docker + 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" + environment: + CGO_ENABLED: 0 + GO111MODULE: on + when: + event: + - tag + +- name: dryrun-docker + pull: always + image: plugins/docker:linux-amd64 + settings: + dockerfile: docker/docker/Dockerfile.linux.amd64 + dry_run: true + password: + from_secret: docker_password repo: plugins/docker - tags: [ "latest", "17", "17.12" ] - secrets: [ docker_username, docker_password ] - dockerfile: docker/Dockerfile - when: - branch: master - event: push + tags: linux-amd64 + username: + from_secret: docker_username + when: + event: + - pull_request - publish_heroku: - image: plugins/docker +- name: publish-docker + pull: always + image: plugins/docker:linux-amd64 + settings: + auto_tag: true + auto_tag_suffix: linux-amd64 + dockerfile: docker/docker/Dockerfile.linux.amd64 + password: + from_secret: docker_password + repo: plugins/docker + username: + from_secret: docker_username + when: + event: + - push + - tag + +- name: build-heroku + 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" + environment: + CGO_ENABLED: 0 + GO111MODULE: on + when: + event: + - push + - pull_request + +- name: build-heroku + 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" + environment: + CGO_ENABLED: 0 + GO111MODULE: on + when: + event: + - tag + +- name: dryrun-heroku + pull: always + image: plugins/docker:linux-amd64 + settings: + dry_run: true + herokufile: docker/heroku/Dockerfile.linux.amd64 + password: + from_secret: heroku_password repo: plugins/heroku - tags: [ "latest", "17", "17.12" ] - secrets: [ docker_username, docker_password ] - dockerfile: docker/heroku/Dockerfile - when: - branch: master - event: push + tags: linux-amd64 + username: + from_secret: heroku_username + when: + event: + - pull_request - publish_gcr: - image: plugins/docker +- name: publish-heroku + pull: always + image: plugins/docker:linux-amd64 + settings: + auto_tag: true + auto_tag_suffix: linux-amd64 + herokufile: docker/heroku/Dockerfile.linux.amd64 + password: + from_secret: heroku_password + repo: plugins/heroku + username: + from_secret: heroku_username + when: + event: + - push + - tag + +- name: build-gcr + 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" + environment: + CGO_ENABLED: 0 + GO111MODULE: on + when: + event: + - push + - pull_request + +- name: build-gcr + 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" + environment: + CGO_ENABLED: 0 + GO111MODULE: on + when: + event: + - tag + +- name: dryrun-gcr + pull: always + image: plugins/docker:linux-amd64 + settings: + dry_run: true + gcrfile: docker/gcr/Dockerfile.linux.amd64 + password: + from_secret: gcr_password repo: plugins/gcr - tags: [ "latest", "17", "17.10" ] - secrets: [ docker_username, docker_password ] - dockerfile: docker/gcr/Dockerfile - when: - branch: master - event: push + tags: linux-amd64 + username: + from_secret: gcr_username + when: + event: + - pull_request - publish_ecr: - image: plugins/docker +- name: publish-gcr + pull: always + image: plugins/docker:linux-amd64 + settings: + auto_tag: true + auto_tag_suffix: linux-amd64 + gcrfile: docker/gcr/Dockerfile.linux.amd64 + password: + from_secret: gcr_password + repo: plugins/gcr + username: + from_secret: gcr_username + when: + event: + - push + - tag + +- name: build-ecr + 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" + environment: + CGO_ENABLED: 0 + GO111MODULE: on + when: + event: + - push + - pull_request + +- name: build-ecr + 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" + environment: + CGO_ENABLED: 0 + GO111MODULE: on + when: + event: + - tag + +- name: dryrun-ecr + pull: always + image: plugins/docker:linux-amd64 + settings: + dockerfile: docker/ecr/Dockerfile.linux.amd64 + dry_run: true + password: + from_secret: ecr_password repo: plugins/ecr - tags: [ "latest", "17", "17.10" ] - secrets: [ docker_username, docker_password ] - dockerfile: docker/ecr/Dockerfile - when: - branch: master - event: push + tags: linux-amd64 + username: + from_secret: ecr_username + when: + event: + - pull_request + +- name: publish-ecr + pull: always + image: plugins/docker:linux-amd64 + settings: + auto_tag: true + auto_tag_suffix: linux-amd64 + dockerfile: docker/ecr/Dockerfile.linux.amd64 + password: + from_secret: ecr_password + repo: plugins/ecr + username: + from_secret: ecr_username + when: + event: + - push + - tag + +trigger: + branch: + - master + +depends_on: +- testing + +--- +kind: pipeline +name: linux-arm64 + +platform: + os: linux + arch: arm64 + +steps: +- name: build-docker + 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" + environment: + CGO_ENABLED: 0 + GO111MODULE: on + when: + event: + - push + - pull_request + +- name: build-docker + 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" + environment: + CGO_ENABLED: 0 + GO111MODULE: on + when: + event: + - tag + +- name: dryrun-docker + pull: always + image: plugins/docker:linux-arm64 + settings: + dockerfile: docker/docker/Dockerfile.linux.arm64 + dry_run: true + password: + from_secret: docker_password + repo: plugins/docker + tags: linux-arm64 + username: + from_secret: docker_username + when: + event: + - pull_request + +- name: publish-docker + pull: always + image: plugins/docker:linux-arm64 + settings: + auto_tag: true + auto_tag_suffix: linux-arm64 + dockerfile: docker/docker/Dockerfile.linux.arm64 + password: + from_secret: docker_password + repo: plugins/docker + username: + from_secret: docker_username + when: + event: + - push + - tag + +- name: build-heroku + 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" + environment: + CGO_ENABLED: 0 + GO111MODULE: on + when: + event: + - push + - pull_request + +- name: build-heroku + 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" + environment: + CGO_ENABLED: 0 + GO111MODULE: on + when: + event: + - tag + +- name: dryrun-heroku + pull: always + image: plugins/docker:linux-arm64 + settings: + dry_run: true + herokufile: docker/heroku/Dockerfile.linux.arm64 + password: + from_secret: heroku_password + repo: plugins/heroku + tags: linux-arm64 + username: + from_secret: heroku_username + when: + event: + - pull_request + +- name: publish-heroku + pull: always + image: plugins/docker:linux-arm64 + settings: + auto_tag: true + auto_tag_suffix: linux-arm64 + herokufile: docker/heroku/Dockerfile.linux.arm64 + password: + from_secret: heroku_password + repo: plugins/heroku + username: + from_secret: heroku_username + when: + event: + - push + - tag + +- name: build-gcr + 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" + environment: + CGO_ENABLED: 0 + GO111MODULE: on + when: + event: + - push + - pull_request + +- name: build-gcr + 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" + environment: + CGO_ENABLED: 0 + GO111MODULE: on + when: + event: + - tag + +- name: dryrun-gcr + pull: always + image: plugins/docker:linux-arm64 + settings: + dry_run: true + gcrfile: docker/gcr/Dockerfile.linux.arm64 + password: + from_secret: gcr_password + repo: plugins/gcr + tags: linux-arm64 + username: + from_secret: gcr_username + when: + event: + - pull_request + +- name: publish-gcr + pull: always + image: plugins/docker:linux-arm64 + settings: + auto_tag: true + auto_tag_suffix: linux-arm64 + gcrfile: docker/gcr/Dockerfile.linux.arm64 + password: + from_secret: gcr_password + repo: plugins/gcr + username: + from_secret: gcr_username + when: + event: + - push + - tag + +- name: build-ecr + 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" + environment: + CGO_ENABLED: 0 + GO111MODULE: on + when: + event: + - push + - pull_request + +- name: build-ecr + 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" + environment: + CGO_ENABLED: 0 + GO111MODULE: on + when: + event: + - tag + +- name: dryrun-ecr + pull: always + image: plugins/docker:linux-arm64 + settings: + dockerfile: docker/ecr/Dockerfile.linux.arm64 + dry_run: true + password: + from_secret: ecr_password + repo: plugins/ecr + tags: linux-arm64 + username: + from_secret: ecr_username + when: + event: + - pull_request + +- name: publish-ecr + pull: always + image: plugins/docker:linux-arm64 + settings: + auto_tag: true + auto_tag_suffix: linux-arm64 + dockerfile: docker/ecr/Dockerfile.linux.arm64 + password: + from_secret: ecr_password + repo: plugins/ecr + username: + from_secret: ecr_username + when: + event: + - push + - tag + +trigger: + branch: + - master + +depends_on: +- testing + +--- +kind: pipeline +name: linux-arm + +platform: + os: linux + arch: arm + +steps: +- name: build-docker + 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" + environment: + CGO_ENABLED: 0 + GO111MODULE: on + when: + event: + - push + - pull_request + +- name: build-docker + 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" + environment: + CGO_ENABLED: 0 + GO111MODULE: on + when: + event: + - tag + +- name: dryrun-docker + pull: always + image: plugins/docker:linux-arm + settings: + dockerfile: docker/docker/Dockerfile.linux.arm + dry_run: true + password: + from_secret: docker_password + repo: plugins/docker + tags: linux-arm + username: + from_secret: docker_username + when: + event: + - pull_request + +- name: publish-docker + pull: always + image: plugins/docker:linux-arm + settings: + auto_tag: true + auto_tag_suffix: linux-arm + dockerfile: docker/docker/Dockerfile.linux.arm + password: + from_secret: docker_password + repo: plugins/docker + username: + from_secret: docker_username + when: + event: + - push + - tag + +- name: build-heroku + 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" + environment: + CGO_ENABLED: 0 + GO111MODULE: on + when: + event: + - push + - pull_request + +- name: build-heroku + 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" + environment: + CGO_ENABLED: 0 + GO111MODULE: on + when: + event: + - tag + +- name: dryrun-heroku + pull: always + image: plugins/docker:linux-arm + settings: + dry_run: true + herokufile: docker/heroku/Dockerfile.linux.arm + password: + from_secret: heroku_password + repo: plugins/heroku + tags: linux-arm + username: + from_secret: heroku_username + when: + event: + - pull_request + +- name: publish-heroku + pull: always + image: plugins/docker:linux-arm + settings: + auto_tag: true + auto_tag_suffix: linux-arm + herokufile: docker/heroku/Dockerfile.linux.arm + password: + from_secret: heroku_password + repo: plugins/heroku + username: + from_secret: heroku_username + when: + event: + - push + - tag + +- name: build-gcr + 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" + environment: + CGO_ENABLED: 0 + GO111MODULE: on + when: + event: + - push + - pull_request + +- name: build-gcr + 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" + environment: + CGO_ENABLED: 0 + GO111MODULE: on + when: + event: + - tag + +- name: dryrun-gcr + pull: always + image: plugins/docker:linux-arm + settings: + dry_run: true + gcrfile: docker/gcr/Dockerfile.linux.arm + password: + from_secret: gcr_password + repo: plugins/gcr + tags: linux-arm + username: + from_secret: gcr_username + when: + event: + - pull_request + +- name: publish-gcr + pull: always + image: plugins/docker:linux-arm + settings: + auto_tag: true + auto_tag_suffix: linux-arm + gcrfile: docker/gcr/Dockerfile.linux.arm + password: + from_secret: gcr_password + repo: plugins/gcr + username: + from_secret: gcr_username + when: + event: + - push + - tag + +- name: build-ecr + 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" + environment: + CGO_ENABLED: 0 + GO111MODULE: on + when: + event: + - push + - pull_request + +- name: build-ecr + 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" + environment: + CGO_ENABLED: 0 + GO111MODULE: on + when: + event: + - tag + +- name: dryrun-ecr + pull: always + image: plugins/docker:linux-arm + settings: + dockerfile: docker/ecr/Dockerfile.linux.arm + dry_run: true + password: + from_secret: ecr_password + repo: plugins/ecr + tags: linux-arm + username: + from_secret: ecr_username + when: + event: + - pull_request + +- name: publish-ecr + pull: always + image: plugins/docker:linux-arm + settings: + auto_tag: true + auto_tag_suffix: linux-arm + dockerfile: docker/ecr/Dockerfile.linux.arm + password: + from_secret: ecr_password + repo: plugins/ecr + username: + from_secret: ecr_username + when: + event: + - push + - tag + +trigger: + branch: + - master + +depends_on: +- testing + +--- +kind: pipeline +name: notifications + +platform: + os: linux + arch: amd64 + +steps: +- name: manifest-docker + pull: always + image: plugins/manifest:1 + settings: + ignore_missing: true + password: + from_secret: docker_password + spec: docker/docker/manifest.tmpl + username: + from_secret: docker_username + +- name: microbadger-docker + pull: always + image: plugins/webhook:1 + settings: + url: + from_secret: microbadger_docker + +- name: manifest-heroku + pull: always + image: plugins/manifest:1 + settings: + ignore_missing: true + password: + from_secret: heroku_password + spec: docker/heroku/manifest.tmpl + username: + from_secret: heroku_username + +- name: microbadger-heroku + pull: always + image: plugins/webhook:1 + settings: + url: + from_secret: microbadger_heroku + +- name: manifest-gcr + pull: always + image: plugins/manifest:1 + settings: + ignore_missing: true + password: + from_secret: gcr_password + spec: docker/gcr/manifest.tmpl + username: + from_secret: gcr_username + +- name: microbadger-gcr + pull: always + image: plugins/webhook:1 + settings: + url: + from_secret: microbadger_gcr + +- name: manifest-ecr + pull: always + image: plugins/manifest:1 + settings: + ignore_missing: true + password: + from_secret: ecr_password + spec: docker/ecr/manifest.tmpl + username: + from_secret: ecr_username + +- name: microbadger-ecr + pull: always + image: plugins/webhook:1 + settings: + url: + from_secret: microbadger_ecr + +trigger: + branch: + - master + event: + - push + - tag + +depends_on: +- linux-amd64 +- linux-arm64 +- linux-arm + +... From 7bea9aab6cb6188c0f0e3f4c9d2f61dbe0b3c09b Mon Sep 17 00:00:00 2001 From: Thomas Boerger Date: Mon, 21 Jan 2019 00:19:15 +0100 Subject: [PATCH 03/16] Update badges within readme --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 4da25ee..cf4b8d9 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,14 @@ # drone-docker +[![Build Status](http://cloud.drone.io/api/badges/drone-plugins/drone-docker/status.svg)](http://cloud.drone.io/drone-plugins/drone-docker) +[![Gitter chat](https://badges.gitter.im/drone/drone.png)](https://gitter.im/drone/drone) +[![Join the discussion at https://discourse.drone.io](https://img.shields.io/badge/discourse-forum-orange.svg)](https://discourse.drone.io) +[![Drone questions at https://stackoverflow.com](https://img.shields.io/badge/drone-stackoverflow-orange.svg)](https://stackoverflow.com/questions/tagged/drone.io) +[![](https://images.microbadger.com/badges/image/plugins/docker.svg)](https://microbadger.com/images/plugins/docker "Get your own image badge on microbadger.com") +[![Go Doc](https://godoc.org/github.com/drone-plugins/drone-docker?status.svg)](http://godoc.org/github.com/drone-plugins/drone-docker) +[![Go Report](https://goreportcard.com/badge/github.com/drone-plugins/drone-docker)](https://goreportcard.com/report/github.com/drone-plugins/drone-docker) +[![](https://images.microbadger.com/badges/image/plugins/docker.svg)](https://microbadger.com/images/plugins/docker "Get your own image badge on microbadger.com") + Drone plugin to build and publish Docker images to a container registry. ## Build From e6289388c467b683c88ab6e2c580ee7719c87c5a Mon Sep 17 00:00:00 2001 From: Thomas Boerger Date: Mon, 21 Jan 2019 01:05:01 +0100 Subject: [PATCH 04/16] Fix duplicated step names --- .drone.jsonnet | 303 ++-------- .drone.windows.yml | 240 +++++--- .drone.yml | 1401 +++++++++++++++++++++++++------------------- 3 files changed, 984 insertions(+), 960 deletions(-) diff --git a/.drone.jsonnet b/.drone.jsonnet index 537f831..6f7c1ad 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -34,16 +34,16 @@ local PipelineTesting = { }, }; -local PipelineBuild(os="linux", arch="amd64") = { +local PipelineBuild(binary="docker", os="linux", arch="amd64") = { kind: "pipeline", - name: os + "-" + arch, + name: os + "-" + arch + "-" + binary, platform: { os: os, arch: arch, }, steps: [ { - name: "build-docker", + name: "build-push", image: "golang:1.11", pull: "always", environment: { @@ -51,14 +51,14 @@ local PipelineBuild(os="linux", arch="amd64") = { GO111MODULE: "on", }, commands: [ - "go build -v -ldflags \"-X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/" + os + "/" + arch + "/drone-docker ./cmd/drone-docker", + "go build -v -ldflags \"-X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/" + os + "/" + arch + "/drone-" + binary + " ./cmd/drone-" + binary, ], when: { event: [ "push", "pull_request" ], }, }, { - name: "build-docker", + name: "build-tag", image: "golang:1.11", pull: "always", environment: { @@ -66,21 +66,21 @@ local PipelineBuild(os="linux", arch="amd64") = { 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-docker ./cmd/drone-docker", + "go build -v -ldflags \"-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/" + os + "/" + arch + "/drone-" + binary + " ./cmd/drone-" + binary, ], when: { event: [ "tag" ], }, }, { - name: "dryrun-docker", + name: "dryrun", image: "plugins/docker:" + os + "-" + arch, pull: "always", settings: { dry_run: true, tags: os + "-" + arch, - dockerfile: "docker/docker/Dockerfile." + os + "." + arch, - repo: "plugins/docker", + dockerfile: "docker/" + binary + "/Dockerfile." + os + "." + arch, + repo: "plugins/" + binary, username: { "from_secret": "docker_username" }, password: { "from_secret": "docker_password" }, }, @@ -89,14 +89,14 @@ local PipelineBuild(os="linux", arch="amd64") = { }, }, { - name: "publish-docker", + name: "publish", image: "plugins/docker:" + os + "-" + arch, pull: "always", settings: { auto_tag: true, auto_tag_suffix: os + "-" + arch, - dockerfile: "docker/docker/Dockerfile." + os + "." + arch, - repo: "plugins/docker", + dockerfile: "docker/" + binary + "/Dockerfile." + os + "." + arch, + repo: "plugins/" + binary, username: { "from_secret": "docker_username" }, password: { "from_secret": "docker_password" }, }, @@ -104,192 +104,6 @@ local PipelineBuild(os="linux", arch="amd64") = { event: [ "push", "tag" ], }, }, - { - name: "build-heroku", - image: "golang:1.11", - pull: "always", - environment: { - CGO_ENABLED: "0", - GO111MODULE: "on", - }, - commands: [ - "go build -v -ldflags \"-X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/" + os + "/" + arch + "/drone-heroku ./cmd/drone-heroku", - ], - when: { - event: [ "push", "pull_request" ], - }, - }, - { - name: "build-heroku", - image: "golang:1.11", - pull: "always", - environment: { - CGO_ENABLED: "0", - 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-heroku ./cmd/drone-heroku", - ], - when: { - event: [ "tag" ], - }, - }, - { - name: "dryrun-heroku", - image: "plugins/docker:" + os + "-" + arch, - pull: "always", - settings: { - dry_run: true, - tags: os + "-" + arch, - herokufile: "docker/heroku/Dockerfile." + os + "." + arch, - repo: "plugins/heroku", - username: { "from_secret": "heroku_username" }, - password: { "from_secret": "heroku_password" }, - }, - when: { - event: [ "pull_request" ], - }, - }, - { - name: "publish-heroku", - image: "plugins/docker:" + os + "-" + arch, - pull: "always", - settings: { - auto_tag: true, - auto_tag_suffix: os + "-" + arch, - herokufile: "docker/heroku/Dockerfile." + os + "." + arch, - repo: "plugins/heroku", - username: { "from_secret": "heroku_username" }, - password: { "from_secret": "heroku_password" }, - }, - when: { - event: [ "push", "tag" ], - }, - }, - { - name: "build-gcr", - image: "golang:1.11", - pull: "always", - environment: { - CGO_ENABLED: "0", - GO111MODULE: "on", - }, - commands: [ - "go build -v -ldflags \"-X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/" + os + "/" + arch + "/drone-gcr ./cmd/drone-gcr", - ], - when: { - event: [ "push", "pull_request" ], - }, - }, - { - name: "build-gcr", - image: "golang:1.11", - pull: "always", - environment: { - CGO_ENABLED: "0", - 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-gcr ./cmd/drone-gcr", - ], - when: { - event: [ "tag" ], - }, - }, - { - name: "dryrun-gcr", - image: "plugins/docker:" + os + "-" + arch, - pull: "always", - settings: { - dry_run: true, - tags: os + "-" + arch, - gcrfile: "docker/gcr/Dockerfile." + os + "." + arch, - repo: "plugins/gcr", - username: { "from_secret": "gcr_username" }, - password: { "from_secret": "gcr_password" }, - }, - when: { - event: [ "pull_request" ], - }, - }, - { - name: "publish-gcr", - image: "plugins/docker:" + os + "-" + arch, - pull: "always", - settings: { - auto_tag: true, - auto_tag_suffix: os + "-" + arch, - gcrfile: "docker/gcr/Dockerfile." + os + "." + arch, - repo: "plugins/gcr", - username: { "from_secret": "gcr_username" }, - password: { "from_secret": "gcr_password" }, - }, - when: { - event: [ "push", "tag" ], - }, - }, - { - name: "build-ecr", - image: "golang:1.11", - pull: "always", - environment: { - CGO_ENABLED: "0", - GO111MODULE: "on", - }, - commands: [ - "go build -v -ldflags \"-X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/" + os + "/" + arch + "/drone-ecr ./cmd/drone-ecr", - ], - when: { - event: [ "push", "pull_request" ], - }, - }, - { - name: "build-ecr", - image: "golang:1.11", - pull: "always", - environment: { - CGO_ENABLED: "0", - 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-ecr ./cmd/drone-ecr", - ], - when: { - event: [ "tag" ], - }, - }, - { - name: "dryrun-ecr", - image: "plugins/docker:" + os + "-" + arch, - pull: "always", - settings: { - dry_run: true, - tags: os + "-" + arch, - dockerfile: "docker/ecr/Dockerfile." + os + "." + arch, - repo: "plugins/ecr", - username: { "from_secret": "ecr_username" }, - password: { "from_secret": "ecr_password" }, - }, - when: { - event: [ "pull_request" ], - }, - }, - { - name: "publish-ecr", - image: "plugins/docker:" + os + "-" + arch, - pull: "always", - settings: { - auto_tag: true, - auto_tag_suffix: os + "-" + arch, - dockerfile: "docker/ecr/Dockerfile." + os + "." + arch, - repo: "plugins/ecr", - username: { "from_secret": "ecr_username" }, - password: { "from_secret": "ecr_password" }, - }, - when: { - event: [ "push", "tag" ], - }, - }, ], depends_on: [ "testing", @@ -299,95 +113,38 @@ local PipelineBuild(os="linux", arch="amd64") = { }, }; -local PipelineNotifications = { +local PipelineNotifications(binary="docker") = { kind: "pipeline", - name: "notifications", + name: "notifications-" + binary, platform: { os: "linux", arch: "amd64", }, steps: [ { - name: "manifest-docker", + name: "manifest", image: "plugins/manifest:1", pull: "always", settings: { username: { "from_secret": "docker_username" }, password: { "from_secret": "docker_password" }, - spec: "docker/docker/manifest.tmpl", + spec: "docker/" + binary + "/manifest.tmpl", ignore_missing: true, }, }, { - name: "microbadger-docker", + name: "microbadger", image: "plugins/webhook:1", pull: "always", settings: { url: { "from_secret": "microbadger_docker" }, }, }, - { - name: "manifest-heroku", - image: "plugins/manifest:1", - pull: "always", - settings: { - username: { "from_secret": "heroku_username" }, - password: { "from_secret": "heroku_password" }, - spec: "docker/heroku/manifest.tmpl", - ignore_missing: true, - }, - }, - { - name: "microbadger-heroku", - image: "plugins/webhook:1", - pull: "always", - settings: { - url: { "from_secret": "microbadger_heroku" }, - }, - }, - { - name: "manifest-gcr", - image: "plugins/manifest:1", - pull: "always", - settings: { - username: { "from_secret": "gcr_username" }, - password: { "from_secret": "gcr_password" }, - spec: "docker/gcr/manifest.tmpl", - ignore_missing: true, - }, - }, - { - name: "microbadger-gcr", - image: "plugins/webhook:1", - pull: "always", - settings: { - url: { "from_secret": "microbadger_gcr" }, - }, - }, - { - name: "manifest-ecr", - image: "plugins/manifest:1", - pull: "always", - settings: { - username: { "from_secret": "ecr_username" }, - password: { "from_secret": "ecr_password" }, - spec: "docker/ecr/manifest.tmpl", - ignore_missing: true, - }, - }, - { - name: "microbadger-ecr", - image: "plugins/webhook:1", - pull: "always", - settings: { - url: { "from_secret": "microbadger_ecr" }, - }, - }, ], depends_on: [ - "linux-amd64", - "linux-arm64", - "linux-arm", + "linux-amd64-" + binary, + "linux-arm64-" + binary, + "linux-arm-" + binary, ], trigger: { branch: [ "master" ], @@ -397,8 +154,20 @@ local PipelineNotifications = { [ PipelineTesting, - PipelineBuild("linux", "amd64"), - PipelineBuild("linux", "arm64"), - PipelineBuild("linux", "arm"), - PipelineNotifications, + PipelineBuild("docker", "linux", "amd64"), + PipelineBuild("docker", "linux", "arm64"), + PipelineBuild("docker", "linux", "arm"), + PipelineBuild("gcr", "linux", "amd64"), + PipelineBuild("gcr", "linux", "arm64"), + PipelineBuild("gcr", "linux", "arm"), + PipelineBuild("ecr", "linux", "amd64"), + PipelineBuild("ecr", "linux", "arm64"), + PipelineBuild("ecr", "linux", "arm"), + PipelineBuild("heroku", "linux", "amd64"), + PipelineBuild("heroku", "linux", "arm64"), + PipelineBuild("heroku", "linux", "arm"), + PipelineNotifications("docker"), + PipelineNotifications("gcr"), + PipelineNotifications("ecr"), + PipelineNotifications("heroku"), ] diff --git a/.drone.windows.yml b/.drone.windows.yml index ec704cc..0d6099c 100644 --- a/.drone.windows.yml +++ b/.drone.windows.yml @@ -1,17 +1,17 @@ --- kind: pipeline -name: linux-amd64 +name: windows-amd64-docker platform: - os: linux + os: windows arch: amd64 steps: -- name: build-docker +- name: build-push 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.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/windows/amd64/drone-docker ./cmd/drone-docker" environment: CGO_ENABLED: 0 GO111MODULE: on @@ -20,11 +20,11 @@ steps: - push - pull_request -- name: build-docker +- name: build-tag 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} -X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/windows/amd64/drone-docker ./cmd/drone-docker" environment: CGO_ENABLED: 0 GO111MODULE: on @@ -32,29 +32,29 @@ steps: event: - tag -- name: dryrun-docker +- name: dryrun pull: always - image: plugins/docker:linux-amd64 + image: plugins/docker:windows-amd64 settings: - dockerfile: docker/docker/Dockerfile.linux.amd64 + dockerfile: docker/docker/Dockerfile.windows.amd64 dry_run: true password: from_secret: docker_password repo: plugins/docker - tags: linux-amd64 + tags: windows-amd64 username: from_secret: docker_username when: event: - pull_request -- name: publish-docker +- name: publish pull: always - image: plugins/docker:linux-amd64 + image: plugins/docker:windows-amd64 settings: auto_tag: true - auto_tag_suffix: linux-amd64 - dockerfile: docker/docker/Dockerfile.linux.amd64 + auto_tag_suffix: windows-amd64 + dockerfile: docker/docker/Dockerfile.windows.amd64 password: from_secret: docker_password repo: plugins/docker @@ -65,11 +65,24 @@ steps: - push - tag -- name: build-heroku +trigger: + branch: + - master + +--- +kind: pipeline +name: windows-amd64-gcr + +platform: + os: windows + arch: amd64 + +steps: +- name: build-push 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.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/windows/amd64/drone-gcr ./cmd/drone-gcr" environment: CGO_ENABLED: 0 GO111MODULE: on @@ -78,11 +91,11 @@ steps: - push - pull_request -- name: build-heroku +- name: build-tag 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} -X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/windows/amd64/drone-gcr ./cmd/drone-gcr" environment: CGO_ENABLED: 0 GO111MODULE: on @@ -90,87 +103,29 @@ steps: event: - tag -- name: dryrun-heroku +- name: dryrun pull: always - image: plugins/docker:linux-amd64 + image: plugins/docker:windows-amd64 settings: dry_run: true - herokufile: docker/heroku/Dockerfile.linux.amd64 - password: - from_secret: heroku_password - repo: plugins/heroku - tags: linux-amd64 - username: - from_secret: heroku_username - when: - event: - - pull_request - -- name: publish-heroku - pull: always - image: plugins/docker:linux-amd64 - settings: - auto_tag: true - auto_tag_suffix: linux-amd64 - herokufile: docker/heroku/Dockerfile.linux.amd64 - password: - from_secret: heroku_password - repo: plugins/heroku - username: - from_secret: heroku_username - when: - event: - - push - - tag - -- name: build-gcr - 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" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - - push - - pull_request - -- name: build-gcr - 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" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - - tag - -- name: dryrun-gcr - pull: always - image: plugins/docker:linux-amd64 - settings: - dry_run: true - gcrfile: docker/gcr/Dockerfile.linux.amd64 + gcrfile: docker/gcr/Dockerfile.windows.amd64 password: from_secret: gcr_password repo: plugins/gcr - tags: linux-amd64 + tags: windows-amd64 username: from_secret: gcr_username when: event: - pull_request -- name: publish-gcr +- name: publish pull: always - image: plugins/docker:linux-amd64 + image: plugins/docker:windows-amd64 settings: auto_tag: true - auto_tag_suffix: linux-amd64 - gcrfile: docker/gcr/Dockerfile.linux.amd64 + auto_tag_suffix: windows-amd64 + gcrfile: docker/gcr/Dockerfile.windows.amd64 password: from_secret: gcr_password repo: plugins/gcr @@ -181,11 +136,27 @@ steps: - push - tag -- name: build-ecr +trigger: + branch: + - master + +depends_on: +- windows-amd64-docker + +--- +kind: pipeline +name: windows-amd64-ecr + +platform: + os: windows + arch: amd64 + +steps: +- name: build-push 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.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/windows/amd64/drone-ecr ./cmd/drone-ecr" environment: CGO_ENABLED: 0 GO111MODULE: on @@ -194,11 +165,11 @@ steps: - push - pull_request -- name: build-ecr +- name: build-tag 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} -X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/windows/amd64/drone-ecr ./cmd/drone-ecr" environment: CGO_ENABLED: 0 GO111MODULE: on @@ -206,29 +177,29 @@ steps: event: - tag -- name: dryrun-ecr +- name: dryrun pull: always - image: plugins/docker:linux-amd64 + image: plugins/docker:windows-amd64 settings: - dockerfile: docker/ecr/Dockerfile.linux.amd64 + dockerfile: docker/ecr/Dockerfile.windows.amd64 dry_run: true password: from_secret: ecr_password repo: plugins/ecr - tags: linux-amd64 + tags: windows-amd64 username: from_secret: ecr_username when: event: - pull_request -- name: publish-ecr +- name: publish pull: always - image: plugins/docker:linux-amd64 + image: plugins/docker:windows-amd64 settings: auto_tag: true - auto_tag_suffix: linux-amd64 - dockerfile: docker/ecr/Dockerfile.linux.amd64 + auto_tag_suffix: windows-amd64 + dockerfile: docker/ecr/Dockerfile.windows.amd64 password: from_secret: ecr_password repo: plugins/ecr @@ -242,3 +213,80 @@ steps: trigger: branch: - master + +depends_on: +- windows-amd64-docker + +--- +kind: pipeline +name: windows-amd64-heroku + +platform: + os: windows + arch: amd64 + +steps: +- name: build-push + pull: always + image: golang:1.11 + commands: + - "go build -v -ldflags \"-X main.build=${DRONE_BUILD_NUMBER}\" -a -tags netgo -o release/windows/amd64/drone-heroku ./cmd/drone-heroku" + environment: + CGO_ENABLED: 0 + GO111MODULE: on + when: + event: + - push + - pull_request + +- name: build-tag + 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/windows/amd64/drone-heroku ./cmd/drone-heroku" + environment: + CGO_ENABLED: 0 + GO111MODULE: on + when: + event: + - tag + +- name: dryrun + pull: always + image: plugins/docker:windows-amd64 + settings: + dry_run: true + herokufile: docker/heroku/Dockerfile.windows.amd64 + password: + from_secret: heroku_password + repo: plugins/heroku + tags: windows-amd64 + username: + from_secret: heroku_username + when: + event: + - pull_request + +- name: publish + pull: always + image: plugins/docker:windows-amd64 + settings: + auto_tag: true + auto_tag_suffix: windows-amd64 + herokufile: docker/heroku/Dockerfile.windows.amd64 + password: + from_secret: heroku_password + repo: plugins/heroku + username: + from_secret: heroku_username + when: + event: + - push + - tag + +trigger: + branch: + - master + +depends_on: +- windows-amd64-docker diff --git a/.drone.yml b/.drone.yml index 319db3a..6571ee8 100644 --- a/.drone.yml +++ b/.drone.yml @@ -29,14 +29,14 @@ trigger: --- kind: pipeline -name: linux-amd64 +name: linux-amd64-docker platform: os: linux arch: amd64 steps: -- name: build-docker +- name: build-push pull: always image: golang:1.11 commands: @@ -49,7 +49,7 @@ steps: - push - pull_request -- name: build-docker +- name: build-tag pull: always image: golang:1.11 commands: @@ -61,7 +61,7 @@ steps: event: - tag -- name: dryrun-docker +- name: dryrun pull: always image: plugins/docker:linux-amd64 settings: @@ -77,7 +77,7 @@ steps: event: - pull_request -- name: publish-docker +- name: publish pull: always image: plugins/docker:linux-amd64 settings: @@ -94,180 +94,6 @@ steps: - push - tag -- name: build-heroku - 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" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - - push - - pull_request - -- name: build-heroku - 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" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - - tag - -- name: dryrun-heroku - pull: always - image: plugins/docker:linux-amd64 - settings: - dry_run: true - herokufile: docker/heroku/Dockerfile.linux.amd64 - password: - from_secret: heroku_password - repo: plugins/heroku - tags: linux-amd64 - username: - from_secret: heroku_username - when: - event: - - pull_request - -- name: publish-heroku - pull: always - image: plugins/docker:linux-amd64 - settings: - auto_tag: true - auto_tag_suffix: linux-amd64 - herokufile: docker/heroku/Dockerfile.linux.amd64 - password: - from_secret: heroku_password - repo: plugins/heroku - username: - from_secret: heroku_username - when: - event: - - push - - tag - -- name: build-gcr - 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" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - - push - - pull_request - -- name: build-gcr - 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" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - - tag - -- name: dryrun-gcr - pull: always - image: plugins/docker:linux-amd64 - settings: - dry_run: true - gcrfile: docker/gcr/Dockerfile.linux.amd64 - password: - from_secret: gcr_password - repo: plugins/gcr - tags: linux-amd64 - username: - from_secret: gcr_username - when: - event: - - pull_request - -- name: publish-gcr - pull: always - image: plugins/docker:linux-amd64 - settings: - auto_tag: true - auto_tag_suffix: linux-amd64 - gcrfile: docker/gcr/Dockerfile.linux.amd64 - password: - from_secret: gcr_password - repo: plugins/gcr - username: - from_secret: gcr_username - when: - event: - - push - - tag - -- name: build-ecr - 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" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - - push - - pull_request - -- name: build-ecr - 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" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - - tag - -- name: dryrun-ecr - pull: always - image: plugins/docker:linux-amd64 - settings: - dockerfile: docker/ecr/Dockerfile.linux.amd64 - dry_run: true - password: - from_secret: ecr_password - repo: plugins/ecr - tags: linux-amd64 - username: - from_secret: ecr_username - when: - event: - - pull_request - -- name: publish-ecr - pull: always - image: plugins/docker:linux-amd64 - settings: - auto_tag: true - auto_tag_suffix: linux-amd64 - dockerfile: docker/ecr/Dockerfile.linux.amd64 - password: - from_secret: ecr_password - repo: plugins/ecr - username: - from_secret: ecr_username - when: - event: - - push - - tag - trigger: branch: - master @@ -277,14 +103,14 @@ depends_on: --- kind: pipeline -name: linux-arm64 +name: linux-arm64-docker platform: os: linux arch: arm64 steps: -- name: build-docker +- name: build-push pull: always image: golang:1.11 commands: @@ -297,7 +123,7 @@ steps: - push - pull_request -- name: build-docker +- name: build-tag pull: always image: golang:1.11 commands: @@ -309,7 +135,7 @@ steps: event: - tag -- name: dryrun-docker +- name: dryrun pull: always image: plugins/docker:linux-arm64 settings: @@ -325,7 +151,7 @@ steps: event: - pull_request -- name: publish-docker +- name: publish pull: always image: plugins/docker:linux-arm64 settings: @@ -342,180 +168,6 @@ steps: - push - tag -- name: build-heroku - 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" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - - push - - pull_request - -- name: build-heroku - 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" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - - tag - -- name: dryrun-heroku - pull: always - image: plugins/docker:linux-arm64 - settings: - dry_run: true - herokufile: docker/heroku/Dockerfile.linux.arm64 - password: - from_secret: heroku_password - repo: plugins/heroku - tags: linux-arm64 - username: - from_secret: heroku_username - when: - event: - - pull_request - -- name: publish-heroku - pull: always - image: plugins/docker:linux-arm64 - settings: - auto_tag: true - auto_tag_suffix: linux-arm64 - herokufile: docker/heroku/Dockerfile.linux.arm64 - password: - from_secret: heroku_password - repo: plugins/heroku - username: - from_secret: heroku_username - when: - event: - - push - - tag - -- name: build-gcr - 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" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - - push - - pull_request - -- name: build-gcr - 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" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - - tag - -- name: dryrun-gcr - pull: always - image: plugins/docker:linux-arm64 - settings: - dry_run: true - gcrfile: docker/gcr/Dockerfile.linux.arm64 - password: - from_secret: gcr_password - repo: plugins/gcr - tags: linux-arm64 - username: - from_secret: gcr_username - when: - event: - - pull_request - -- name: publish-gcr - pull: always - image: plugins/docker:linux-arm64 - settings: - auto_tag: true - auto_tag_suffix: linux-arm64 - gcrfile: docker/gcr/Dockerfile.linux.arm64 - password: - from_secret: gcr_password - repo: plugins/gcr - username: - from_secret: gcr_username - when: - event: - - push - - tag - -- name: build-ecr - 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" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - - push - - pull_request - -- name: build-ecr - 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" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - - tag - -- name: dryrun-ecr - pull: always - image: plugins/docker:linux-arm64 - settings: - dockerfile: docker/ecr/Dockerfile.linux.arm64 - dry_run: true - password: - from_secret: ecr_password - repo: plugins/ecr - tags: linux-arm64 - username: - from_secret: ecr_username - when: - event: - - pull_request - -- name: publish-ecr - pull: always - image: plugins/docker:linux-arm64 - settings: - auto_tag: true - auto_tag_suffix: linux-arm64 - dockerfile: docker/ecr/Dockerfile.linux.arm64 - password: - from_secret: ecr_password - repo: plugins/ecr - username: - from_secret: ecr_username - when: - event: - - push - - tag - trigger: branch: - master @@ -525,14 +177,14 @@ depends_on: --- kind: pipeline -name: linux-arm +name: linux-arm-docker platform: os: linux arch: arm steps: -- name: build-docker +- name: build-push pull: always image: golang:1.11 commands: @@ -545,7 +197,7 @@ steps: - push - pull_request -- name: build-docker +- name: build-tag pull: always image: golang:1.11 commands: @@ -557,7 +209,7 @@ steps: event: - tag -- name: dryrun-docker +- name: dryrun pull: always image: plugins/docker:linux-arm settings: @@ -573,7 +225,7 @@ steps: event: - pull_request -- name: publish-docker +- name: publish pull: always image: plugins/docker:linux-arm settings: @@ -590,180 +242,6 @@ steps: - push - tag -- name: build-heroku - 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" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - - push - - pull_request - -- name: build-heroku - 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" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - - tag - -- name: dryrun-heroku - pull: always - image: plugins/docker:linux-arm - settings: - dry_run: true - herokufile: docker/heroku/Dockerfile.linux.arm - password: - from_secret: heroku_password - repo: plugins/heroku - tags: linux-arm - username: - from_secret: heroku_username - when: - event: - - pull_request - -- name: publish-heroku - pull: always - image: plugins/docker:linux-arm - settings: - auto_tag: true - auto_tag_suffix: linux-arm - herokufile: docker/heroku/Dockerfile.linux.arm - password: - from_secret: heroku_password - repo: plugins/heroku - username: - from_secret: heroku_username - when: - event: - - push - - tag - -- name: build-gcr - 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" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - - push - - pull_request - -- name: build-gcr - 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" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - - tag - -- name: dryrun-gcr - pull: always - image: plugins/docker:linux-arm - settings: - dry_run: true - gcrfile: docker/gcr/Dockerfile.linux.arm - password: - from_secret: gcr_password - repo: plugins/gcr - tags: linux-arm - username: - from_secret: gcr_username - when: - event: - - pull_request - -- name: publish-gcr - pull: always - image: plugins/docker:linux-arm - settings: - auto_tag: true - auto_tag_suffix: linux-arm - gcrfile: docker/gcr/Dockerfile.linux.arm - password: - from_secret: gcr_password - repo: plugins/gcr - username: - from_secret: gcr_username - when: - event: - - push - - tag - -- name: build-ecr - 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" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - - push - - pull_request - -- name: build-ecr - 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" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - - tag - -- name: dryrun-ecr - pull: always - image: plugins/docker:linux-arm - settings: - dockerfile: docker/ecr/Dockerfile.linux.arm - dry_run: true - password: - from_secret: ecr_password - repo: plugins/ecr - tags: linux-arm - username: - from_secret: ecr_username - when: - event: - - pull_request - -- name: publish-ecr - pull: always - image: plugins/docker:linux-arm - settings: - auto_tag: true - auto_tag_suffix: linux-arm - dockerfile: docker/ecr/Dockerfile.linux.arm - password: - from_secret: ecr_password - repo: plugins/ecr - username: - from_secret: ecr_username - when: - event: - - push - - tag - trigger: branch: - master @@ -773,14 +251,680 @@ depends_on: --- kind: pipeline -name: notifications +name: linux-amd64-gcr platform: os: linux arch: amd64 steps: -- name: manifest-docker +- name: build-push + 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" + environment: + CGO_ENABLED: 0 + GO111MODULE: on + when: + event: + - push + - pull_request + +- name: build-tag + 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" + environment: + CGO_ENABLED: 0 + GO111MODULE: on + when: + event: + - tag + +- name: dryrun + pull: always + image: plugins/docker:linux-amd64 + settings: + dockerfile: docker/gcr/Dockerfile.linux.amd64 + dry_run: true + password: + from_secret: docker_password + repo: plugins/gcr + tags: linux-amd64 + username: + from_secret: docker_username + when: + event: + - pull_request + +- name: publish + pull: always + image: plugins/docker:linux-amd64 + settings: + auto_tag: true + auto_tag_suffix: linux-amd64 + dockerfile: docker/gcr/Dockerfile.linux.amd64 + password: + from_secret: docker_password + repo: plugins/gcr + username: + from_secret: docker_username + when: + event: + - push + - tag + +trigger: + branch: + - master + +depends_on: +- testing + +--- +kind: pipeline +name: linux-arm64-gcr + +platform: + os: linux + arch: arm64 + +steps: +- name: build-push + 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" + environment: + CGO_ENABLED: 0 + GO111MODULE: on + when: + event: + - push + - pull_request + +- name: build-tag + 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" + environment: + CGO_ENABLED: 0 + GO111MODULE: on + when: + event: + - tag + +- name: dryrun + pull: always + image: plugins/docker:linux-arm64 + settings: + dockerfile: docker/gcr/Dockerfile.linux.arm64 + dry_run: true + password: + from_secret: docker_password + repo: plugins/gcr + tags: linux-arm64 + username: + from_secret: docker_username + when: + event: + - pull_request + +- name: publish + pull: always + image: plugins/docker:linux-arm64 + settings: + auto_tag: true + auto_tag_suffix: linux-arm64 + dockerfile: docker/gcr/Dockerfile.linux.arm64 + password: + from_secret: docker_password + repo: plugins/gcr + username: + from_secret: docker_username + when: + event: + - push + - tag + +trigger: + branch: + - master + +depends_on: +- testing + +--- +kind: pipeline +name: linux-arm-gcr + +platform: + os: linux + arch: arm + +steps: +- name: build-push + 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" + environment: + CGO_ENABLED: 0 + GO111MODULE: on + when: + event: + - push + - pull_request + +- name: build-tag + 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" + environment: + CGO_ENABLED: 0 + GO111MODULE: on + when: + event: + - tag + +- name: dryrun + pull: always + image: plugins/docker:linux-arm + settings: + dockerfile: docker/gcr/Dockerfile.linux.arm + dry_run: true + password: + from_secret: docker_password + repo: plugins/gcr + tags: linux-arm + username: + from_secret: docker_username + when: + event: + - pull_request + +- name: publish + pull: always + image: plugins/docker:linux-arm + settings: + auto_tag: true + auto_tag_suffix: linux-arm + dockerfile: docker/gcr/Dockerfile.linux.arm + password: + from_secret: docker_password + repo: plugins/gcr + username: + from_secret: docker_username + when: + event: + - push + - tag + +trigger: + branch: + - master + +depends_on: +- testing + +--- +kind: pipeline +name: linux-amd64-ecr + +platform: + os: linux + arch: amd64 + +steps: +- name: build-push + 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" + environment: + CGO_ENABLED: 0 + GO111MODULE: on + when: + event: + - push + - pull_request + +- name: build-tag + 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" + environment: + CGO_ENABLED: 0 + GO111MODULE: on + when: + event: + - tag + +- name: dryrun + pull: always + image: plugins/docker:linux-amd64 + settings: + dockerfile: docker/ecr/Dockerfile.linux.amd64 + dry_run: true + password: + from_secret: docker_password + repo: plugins/ecr + tags: linux-amd64 + username: + from_secret: docker_username + when: + event: + - pull_request + +- name: publish + pull: always + image: plugins/docker:linux-amd64 + settings: + auto_tag: true + auto_tag_suffix: linux-amd64 + dockerfile: docker/ecr/Dockerfile.linux.amd64 + password: + from_secret: docker_password + repo: plugins/ecr + username: + from_secret: docker_username + when: + event: + - push + - tag + +trigger: + branch: + - master + +depends_on: +- testing + +--- +kind: pipeline +name: linux-arm64-ecr + +platform: + os: linux + arch: arm64 + +steps: +- name: build-push + 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" + environment: + CGO_ENABLED: 0 + GO111MODULE: on + when: + event: + - push + - pull_request + +- name: build-tag + 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" + environment: + CGO_ENABLED: 0 + GO111MODULE: on + when: + event: + - tag + +- name: dryrun + pull: always + image: plugins/docker:linux-arm64 + settings: + dockerfile: docker/ecr/Dockerfile.linux.arm64 + dry_run: true + password: + from_secret: docker_password + repo: plugins/ecr + tags: linux-arm64 + username: + from_secret: docker_username + when: + event: + - pull_request + +- name: publish + pull: always + image: plugins/docker:linux-arm64 + settings: + auto_tag: true + auto_tag_suffix: linux-arm64 + dockerfile: docker/ecr/Dockerfile.linux.arm64 + password: + from_secret: docker_password + repo: plugins/ecr + username: + from_secret: docker_username + when: + event: + - push + - tag + +trigger: + branch: + - master + +depends_on: +- testing + +--- +kind: pipeline +name: linux-arm-ecr + +platform: + os: linux + arch: arm + +steps: +- name: build-push + 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" + environment: + CGO_ENABLED: 0 + GO111MODULE: on + when: + event: + - push + - pull_request + +- name: build-tag + 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" + environment: + CGO_ENABLED: 0 + GO111MODULE: on + when: + event: + - tag + +- name: dryrun + pull: always + image: plugins/docker:linux-arm + settings: + dockerfile: docker/ecr/Dockerfile.linux.arm + dry_run: true + password: + from_secret: docker_password + repo: plugins/ecr + tags: linux-arm + username: + from_secret: docker_username + when: + event: + - pull_request + +- name: publish + pull: always + image: plugins/docker:linux-arm + settings: + auto_tag: true + auto_tag_suffix: linux-arm + dockerfile: docker/ecr/Dockerfile.linux.arm + password: + from_secret: docker_password + repo: plugins/ecr + username: + from_secret: docker_username + when: + event: + - push + - tag + +trigger: + branch: + - master + +depends_on: +- testing + +--- +kind: pipeline +name: linux-amd64-heroku + +platform: + os: linux + arch: amd64 + +steps: +- name: build-push + 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" + environment: + CGO_ENABLED: 0 + GO111MODULE: on + when: + event: + - push + - pull_request + +- name: build-tag + 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" + environment: + CGO_ENABLED: 0 + GO111MODULE: on + when: + event: + - tag + +- name: dryrun + pull: always + image: plugins/docker:linux-amd64 + settings: + dockerfile: docker/heroku/Dockerfile.linux.amd64 + dry_run: true + password: + from_secret: docker_password + repo: plugins/heroku + tags: linux-amd64 + username: + from_secret: docker_username + when: + event: + - pull_request + +- name: publish + pull: always + image: plugins/docker:linux-amd64 + settings: + auto_tag: true + auto_tag_suffix: linux-amd64 + dockerfile: docker/heroku/Dockerfile.linux.amd64 + password: + from_secret: docker_password + repo: plugins/heroku + username: + from_secret: docker_username + when: + event: + - push + - tag + +trigger: + branch: + - master + +depends_on: +- testing + +--- +kind: pipeline +name: linux-arm64-heroku + +platform: + os: linux + arch: arm64 + +steps: +- name: build-push + 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" + environment: + CGO_ENABLED: 0 + GO111MODULE: on + when: + event: + - push + - pull_request + +- name: build-tag + 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" + environment: + CGO_ENABLED: 0 + GO111MODULE: on + when: + event: + - tag + +- name: dryrun + pull: always + image: plugins/docker:linux-arm64 + settings: + dockerfile: docker/heroku/Dockerfile.linux.arm64 + dry_run: true + password: + from_secret: docker_password + repo: plugins/heroku + tags: linux-arm64 + username: + from_secret: docker_username + when: + event: + - pull_request + +- name: publish + pull: always + image: plugins/docker:linux-arm64 + settings: + auto_tag: true + auto_tag_suffix: linux-arm64 + dockerfile: docker/heroku/Dockerfile.linux.arm64 + password: + from_secret: docker_password + repo: plugins/heroku + username: + from_secret: docker_username + when: + event: + - push + - tag + +trigger: + branch: + - master + +depends_on: +- testing + +--- +kind: pipeline +name: linux-arm-heroku + +platform: + os: linux + arch: arm + +steps: +- name: build-push + 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" + environment: + CGO_ENABLED: 0 + GO111MODULE: on + when: + event: + - push + - pull_request + +- name: build-tag + 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" + environment: + CGO_ENABLED: 0 + GO111MODULE: on + when: + event: + - tag + +- name: dryrun + pull: always + image: plugins/docker:linux-arm + settings: + dockerfile: docker/heroku/Dockerfile.linux.arm + dry_run: true + password: + from_secret: docker_password + repo: plugins/heroku + tags: linux-arm + username: + from_secret: docker_username + when: + event: + - pull_request + +- name: publish + pull: always + image: plugins/docker:linux-arm + settings: + auto_tag: true + auto_tag_suffix: linux-arm + dockerfile: docker/heroku/Dockerfile.linux.arm + password: + from_secret: docker_password + repo: plugins/heroku + username: + from_secret: docker_username + when: + event: + - push + - tag + +trigger: + branch: + - master + +depends_on: +- testing + +--- +kind: pipeline +name: notifications-docker + +platform: + os: linux + arch: amd64 + +steps: +- name: manifest pull: always image: plugins/manifest:1 settings: @@ -791,67 +935,13 @@ steps: username: from_secret: docker_username -- name: microbadger-docker +- name: microbadger pull: always image: plugins/webhook:1 settings: url: from_secret: microbadger_docker -- name: manifest-heroku - pull: always - image: plugins/manifest:1 - settings: - ignore_missing: true - password: - from_secret: heroku_password - spec: docker/heroku/manifest.tmpl - username: - from_secret: heroku_username - -- name: microbadger-heroku - pull: always - image: plugins/webhook:1 - settings: - url: - from_secret: microbadger_heroku - -- name: manifest-gcr - pull: always - image: plugins/manifest:1 - settings: - ignore_missing: true - password: - from_secret: gcr_password - spec: docker/gcr/manifest.tmpl - username: - from_secret: gcr_username - -- name: microbadger-gcr - pull: always - image: plugins/webhook:1 - settings: - url: - from_secret: microbadger_gcr - -- name: manifest-ecr - pull: always - image: plugins/manifest:1 - settings: - ignore_missing: true - password: - from_secret: ecr_password - spec: docker/ecr/manifest.tmpl - username: - from_secret: ecr_username - -- name: microbadger-ecr - pull: always - image: plugins/webhook:1 - settings: - url: - from_secret: microbadger_ecr - trigger: branch: - master @@ -860,8 +950,125 @@ trigger: - tag depends_on: -- linux-amd64 -- linux-arm64 -- linux-arm +- linux-amd64-docker +- linux-arm64-docker +- linux-arm-docker + +--- +kind: pipeline +name: notifications-gcr + +platform: + os: linux + arch: amd64 + +steps: +- name: manifest + pull: always + image: plugins/manifest:1 + settings: + ignore_missing: true + password: + from_secret: docker_password + spec: docker/gcr/manifest.tmpl + username: + from_secret: docker_username + +- name: microbadger + pull: always + image: plugins/webhook:1 + settings: + url: + from_secret: microbadger_docker + +trigger: + branch: + - master + event: + - push + - tag + +depends_on: +- linux-amd64-gcr +- linux-arm64-gcr +- linux-arm-gcr + +--- +kind: pipeline +name: notifications-ecr + +platform: + os: linux + arch: amd64 + +steps: +- name: manifest + pull: always + image: plugins/manifest:1 + settings: + ignore_missing: true + password: + from_secret: docker_password + spec: docker/ecr/manifest.tmpl + username: + from_secret: docker_username + +- name: microbadger + pull: always + image: plugins/webhook:1 + settings: + url: + from_secret: microbadger_docker + +trigger: + branch: + - master + event: + - push + - tag + +depends_on: +- linux-amd64-ecr +- linux-arm64-ecr +- linux-arm-ecr + +--- +kind: pipeline +name: notifications-heroku + +platform: + os: linux + arch: amd64 + +steps: +- name: manifest + pull: always + image: plugins/manifest:1 + settings: + ignore_missing: true + password: + from_secret: docker_password + spec: docker/heroku/manifest.tmpl + username: + from_secret: docker_username + +- name: microbadger + pull: always + image: plugins/webhook:1 + settings: + url: + from_secret: microbadger_docker + +trigger: + branch: + - master + event: + - push + - tag + +depends_on: +- linux-amd64-heroku +- linux-arm64-heroku +- linux-arm-heroku ... From 17dc3bc6be3efb8851dfdf05192dcb7898b212fc Mon Sep 17 00:00:00 2001 From: Thomas Boerger Date: Mon, 21 Jan 2019 01:22:48 +0100 Subject: [PATCH 05/16] Switch to go modules instead of go dep --- Gopkg.lock | 63 ---------------------------------------- Gopkg.toml | 43 --------------------------- cmd/drone-docker/main.go | 2 +- docker.go | 2 +- go.mod | 12 ++++++++ go.sum | 33 +++++++++++++++++++++ 6 files changed, 47 insertions(+), 108 deletions(-) delete mode 100644 Gopkg.lock delete mode 100644 Gopkg.toml create mode 100644 go.mod create mode 100644 go.sum diff --git a/Gopkg.lock b/Gopkg.lock deleted file mode 100644 index 599ad9a..0000000 --- a/Gopkg.lock +++ /dev/null @@ -1,63 +0,0 @@ -# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. - - -[[projects]] - name = "github.com/Sirupsen/logrus" - packages = ["."] - revision = "f006c2ac4710855cf0f916dd6b77acf6b048dc6e" - version = "v1.0.3" - -[[projects]] - name = "github.com/aws/aws-sdk-go" - packages = ["aws","aws/awserr","aws/awsutil","aws/client","aws/client/metadata","aws/corehandlers","aws/credentials","aws/credentials/ec2rolecreds","aws/credentials/endpointcreds","aws/credentials/stscreds","aws/defaults","aws/ec2metadata","aws/endpoints","aws/request","aws/session","aws/signer/v4","internal/shareddefaults","private/protocol","private/protocol/json/jsonutil","private/protocol/jsonrpc","private/protocol/query","private/protocol/query/queryutil","private/protocol/rest","private/protocol/xml/xmlutil","service/ecr","service/sts"] - revision = "ee1f179877b2daf2aaabf71fa900773bf8842253" - version = "v1.12.19" - -[[projects]] - name = "github.com/coreos/go-semver" - packages = ["semver"] - revision = "8ab6407b697782a06568d4b7f1db25550ec2e4c6" - version = "v0.2.0" - -[[projects]] - name = "github.com/go-ini/ini" - packages = ["."] - revision = "f280b3ba517bf5fc98922624f21fb0e7a92adaec" - version = "v1.30.3" - -[[projects]] - name = "github.com/jmespath/go-jmespath" - packages = ["."] - revision = "0b12d6b5" - -[[projects]] - name = "github.com/joho/godotenv" - packages = ["."] - revision = "a79fa1e548e2c689c241d10173efd51e5d689d5b" - version = "v1.2.0" - -[[projects]] - branch = "master" - name = "github.com/urfave/cli" - packages = ["."] - revision = "0d51abd87c7705e9ee80d7227d77fcea82d69b7f" - source = "https://github.com/bradrydzewski/cli.git" - -[[projects]] - branch = "master" - name = "golang.org/x/crypto" - packages = ["ssh/terminal"] - revision = "2509b142fb2b797aa7587dad548f113b2c0f20ce" - -[[projects]] - branch = "master" - name = "golang.org/x/sys" - packages = ["unix","windows"] - revision = "661970f62f5897bc0cd5fdca7e087ba8a98a8fa1" - -[solve-meta] - analyzer-name = "dep" - analyzer-version = 1 - inputs-digest = "d810a46da78466106fe9f994d288826e0c876cef7addebade091f62c1a1522a1" - solver-name = "gps-cdcl" - solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml deleted file mode 100644 index 9357288..0000000 --- a/Gopkg.toml +++ /dev/null @@ -1,43 +0,0 @@ - -# Gopkg.toml example -# -# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md -# for detailed Gopkg.toml documentation. -# -# required = ["github.com/user/thing/cmd/thing"] -# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] -# -# [[constraint]] -# name = "github.com/user/project" -# version = "1.0.0" -# -# [[constraint]] -# name = "github.com/user/project2" -# branch = "dev" -# source = "github.com/myfork/project2" -# -# [[override]] -# name = "github.com/x/y" -# version = "2.4.0" - - -[[constraint]] - name = "github.com/Sirupsen/logrus" - version = "1.0.3" - -[[constraint]] - name = "github.com/aws/aws-sdk-go" - version = "1.12.19" - -[[constraint]] - name = "github.com/joho/godotenv" - version = "1.2.0" - -[[constraint]] - branch = "master" - name = "github.com/urfave/cli" - source = "https://github.com/bradrydzewski/cli.git" - -[[constraint]] - name = "github.com/coreos/go-semver" - version = "v0.2.0" diff --git a/cmd/drone-docker/main.go b/cmd/drone-docker/main.go index 89cc480..145997b 100644 --- a/cmd/drone-docker/main.go +++ b/cmd/drone-docker/main.go @@ -4,8 +4,8 @@ import ( "fmt" "os" - "github.com/Sirupsen/logrus" "github.com/joho/godotenv" + "github.com/sirupsen/logrus" "github.com/urfave/cli" "github.com/drone-plugins/drone-docker" diff --git a/docker.go b/docker.go index c3c7332..decdab7 100644 --- a/docker.go +++ b/docker.go @@ -172,7 +172,7 @@ func commandLogin(login Login) *exec.Cmd { // helper to check if args match "docker pull " func isCommandPull(args []string) bool { - return len(args) > 2 && args[1] == "pull" + return len(args) > 2 && args[1] == "pull" } func commandPull(repo string) *exec.Cmd { diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..8ca076e --- /dev/null +++ b/go.mod @@ -0,0 +1,12 @@ +module github.com/drone-plugins/drone-docker + +require ( + github.com/aws/aws-sdk-go v1.16.15 + github.com/coreos/go-semver v0.2.0 + github.com/joho/godotenv v1.3.0 + github.com/sirupsen/logrus v1.3.0 + github.com/urfave/cli v1.20.0 + golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e // indirect + golang.org/x/text v0.3.0 // indirect + gopkg.in/yaml.v2 v2.2.2 // indirect +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..a7b1eba --- /dev/null +++ b/go.sum @@ -0,0 +1,33 @@ +github.com/aws/aws-sdk-go v1.16.15 h1:kQyxfRyjAwIYjf0225sn/pn+WAlncKyI8dmT3+ItMFE= +github.com/aws/aws-sdk-go v1.16.15/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/coreos/go-semver v0.2.0 h1:3Jm3tLmsgAYcjC+4Up7hJrFBPr+n7rAqYeSw/SZazuY= +github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af h1:pmfjZENx5imkbgOkpRUYLnmbU7UEFbjtDA2hxJ1ichM= +github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= +github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= +github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/sirupsen/logrus v1.3.0 h1:hI/7Q+DtNZ2kINb6qt/lS+IyXnHQe9e90POfeewL/ME= +github.com/sirupsen/logrus v1.3.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/urfave/cli v1.20.0 h1:fDqGv3UG/4jbVl/QkFwEdddtEDjh/5Ov6X+0B/3bPaw= +github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793 h1:u+LnwYTOOW7Ukr/fppxEb1Nwz0AtPflrblfvUudpo+I= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33 h1:I6FyU15t786LL7oL/hn43zqTuEGr4PN7F4XJ1p4E3Y8= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= From 76ac11d2210e5e5dab03bb94215a80d2674fcd8d Mon Sep 17 00:00:00 2001 From: Thomas Boerger Date: Mon, 21 Jan 2019 01:34:03 +0100 Subject: [PATCH 06/16] Use FilePath enabled urfave/cli lib --- go.mod | 2 ++ go.sum | 1 + 2 files changed, 3 insertions(+) diff --git a/go.mod b/go.mod index 8ca076e..9f5a2f2 100644 --- a/go.mod +++ b/go.mod @@ -10,3 +10,5 @@ require ( golang.org/x/text v0.3.0 // indirect gopkg.in/yaml.v2 v2.2.2 // indirect ) + +replace github.com/urfave/cli => github.com/bradrydzewski/cli v0.0.0-20190108225652-0d51abd87c77 diff --git a/go.sum b/go.sum index a7b1eba..1c09484 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,6 @@ github.com/aws/aws-sdk-go v1.16.15 h1:kQyxfRyjAwIYjf0225sn/pn+WAlncKyI8dmT3+ItMFE= github.com/aws/aws-sdk-go v1.16.15/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/bradrydzewski/cli v0.0.0-20190108225652-0d51abd87c77/go.mod h1:4SmsVk3pOgYeJlG54e23Ztd/HucXeH5RmH5bNO+uOpk= github.com/coreos/go-semver v0.2.0 h1:3Jm3tLmsgAYcjC+4Up7hJrFBPr+n7rAqYeSw/SZazuY= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= From 7345afea5dc32780ad65c148a08132e5088836f8 Mon Sep 17 00:00:00 2001 From: Thomas Boerger Date: Mon, 21 Jan 2019 01:38:45 +0100 Subject: [PATCH 07/16] Drop docker from binary name for gcr, ecr and heroku --- cmd/{drone-docker-ecr => drone-ecr}/main.go | 0 cmd/{drone-docker-ecr => drone-ecr}/main_test.go | 0 cmd/{drone-docker-gcr => drone-gcr}/main.go | 0 cmd/{drone-docker-heroku => drone-heroku}/main.go | 0 docker/ecr/Dockerfile | 6 ++---- docker/ecr/Dockerfile.arm64 | 4 ++-- docker/gcr/Dockerfile | 6 ++---- docker/gcr/Dockerfile.arm64 | 4 ++-- docker/heroku/Dockerfile | 6 ++---- docker/heroku/Dockerfile.arm64 | 4 ++-- 10 files changed, 12 insertions(+), 18 deletions(-) rename cmd/{drone-docker-ecr => drone-ecr}/main.go (100%) rename cmd/{drone-docker-ecr => drone-ecr}/main_test.go (100%) rename cmd/{drone-docker-gcr => drone-gcr}/main.go (100%) rename cmd/{drone-docker-heroku => drone-heroku}/main.go (100%) diff --git a/cmd/drone-docker-ecr/main.go b/cmd/drone-ecr/main.go similarity index 100% rename from cmd/drone-docker-ecr/main.go rename to cmd/drone-ecr/main.go diff --git a/cmd/drone-docker-ecr/main_test.go b/cmd/drone-ecr/main_test.go similarity index 100% rename from cmd/drone-docker-ecr/main_test.go rename to cmd/drone-ecr/main_test.go diff --git a/cmd/drone-docker-gcr/main.go b/cmd/drone-gcr/main.go similarity index 100% rename from cmd/drone-docker-gcr/main.go rename to cmd/drone-gcr/main.go diff --git a/cmd/drone-docker-heroku/main.go b/cmd/drone-heroku/main.go similarity index 100% rename from cmd/drone-docker-heroku/main.go rename to cmd/drone-heroku/main.go diff --git a/docker/ecr/Dockerfile b/docker/ecr/Dockerfile index e50563e..d941387 100644 --- a/docker/ecr/Dockerfile +++ b/docker/ecr/Dockerfile @@ -1,6 +1,4 @@ -# docker build --rm -f docker/ecr/Dockerfile -t plugins/ecr . - FROM plugins/docker:latest -ADD release/linux/amd64/drone-docker-ecr /bin/ -ENTRYPOINT ["/usr/local/bin/dockerd-entrypoint.sh", "/bin/drone-docker-ecr"] +ADD release/linux/amd64/drone-ecr /bin/ +ENTRYPOINT ["/usr/local/bin/dockerd-entrypoint.sh", "/bin/drone-ecr"] diff --git a/docker/ecr/Dockerfile.arm64 b/docker/ecr/Dockerfile.arm64 index 600273c..83ed26a 100644 --- a/docker/ecr/Dockerfile.arm64 +++ b/docker/ecr/Dockerfile.arm64 @@ -1,4 +1,4 @@ FROM plugins/docker:linux-arm64 -ADD release/linux/arm64/drone-docker-ecr /bin/ -ENTRYPOINT ["/usr/local/bin/dockerd-entrypoint.sh", "/bin/drone-docker-ecr"] \ No newline at end of file +ADD release/linux/arm64/drone-ecr /bin/ +ENTRYPOINT ["/usr/local/bin/dockerd-entrypoint.sh", "/bin/drone-ecr"] diff --git a/docker/gcr/Dockerfile b/docker/gcr/Dockerfile index 92d562d..e982ef9 100644 --- a/docker/gcr/Dockerfile +++ b/docker/gcr/Dockerfile @@ -1,6 +1,4 @@ -# docker build --rm -f docker/gcr/Dockerfile -t plugins/gcr . - FROM plugins/docker:latest -ADD release/linux/amd64/drone-docker-gcr /bin/ -ENTRYPOINT ["/usr/local/bin/dockerd-entrypoint.sh", "/bin/drone-docker-gcr"] +ADD release/linux/amd64/drone-gcr /bin/ +ENTRYPOINT ["/usr/local/bin/dockerd-entrypoint.sh", "/bin/drone-gcr"] diff --git a/docker/gcr/Dockerfile.arm64 b/docker/gcr/Dockerfile.arm64 index 49c049b..396e373 100644 --- a/docker/gcr/Dockerfile.arm64 +++ b/docker/gcr/Dockerfile.arm64 @@ -1,4 +1,4 @@ FROM plugins/docker:linux-arm64 -ADD release/linux/arm64/drone-docker-gcr /bin/ -ENTRYPOINT ["/usr/local/bin/dockerd-entrypoint.sh", "/bin/drone-docker-gcr"] +ADD release/linux/arm64/drone-gcr /bin/ +ENTRYPOINT ["/usr/local/bin/dockerd-entrypoint.sh", "/bin/drone-gcr"] diff --git a/docker/heroku/Dockerfile b/docker/heroku/Dockerfile index 6f53c65..c06cdb6 100644 --- a/docker/heroku/Dockerfile +++ b/docker/heroku/Dockerfile @@ -1,6 +1,4 @@ -# docker build --rm -f docker/heroku/Dockerfile -t plugins/heroku . - FROM plugins/docker:latest -ADD release/linux/amd64/drone-docker-heroku /bin/ -ENTRYPOINT ["/usr/local/bin/dockerd-entrypoint.sh", "/bin/drone-docker-heroku"] +ADD release/linux/amd64/drone-heroku /bin/ +ENTRYPOINT ["/usr/local/bin/dockerd-entrypoint.sh", "/bin/drone-heroku"] diff --git a/docker/heroku/Dockerfile.arm64 b/docker/heroku/Dockerfile.arm64 index c9e9fe8..e49f7c6 100644 --- a/docker/heroku/Dockerfile.arm64 +++ b/docker/heroku/Dockerfile.arm64 @@ -1,4 +1,4 @@ FROM plugins/docker:linux-arm64 -ADD release/linux/arm64/drone-docker-heroku /bin/ -ENTRYPOINT ["/usr/local/bin/dockerd-entrypoint.sh", "/bin/drone-docker-heroku"] +ADD release/linux/arm64/drone-heroku /bin/ +ENTRYPOINT ["/usr/local/bin/dockerd-entrypoint.sh", "/bin/drone-heroku"] From c76794b50f6e9e179ddf53eee953191b4dad1d11 Mon Sep 17 00:00:00 2001 From: Thomas Boerger Date: Mon, 21 Jan 2019 01:39:52 +0100 Subject: [PATCH 08/16] Drop arm builds for now --- .drone.jsonnet | 5 - .drone.yml | 300 ------------------------------------------------- 2 files changed, 305 deletions(-) diff --git a/.drone.jsonnet b/.drone.jsonnet index 6f7c1ad..4a9268f 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -144,7 +144,6 @@ local PipelineNotifications(binary="docker") = { depends_on: [ "linux-amd64-" + binary, "linux-arm64-" + binary, - "linux-arm-" + binary, ], trigger: { branch: [ "master" ], @@ -156,16 +155,12 @@ local PipelineNotifications(binary="docker") = { PipelineTesting, PipelineBuild("docker", "linux", "amd64"), PipelineBuild("docker", "linux", "arm64"), - PipelineBuild("docker", "linux", "arm"), PipelineBuild("gcr", "linux", "amd64"), PipelineBuild("gcr", "linux", "arm64"), - PipelineBuild("gcr", "linux", "arm"), PipelineBuild("ecr", "linux", "amd64"), PipelineBuild("ecr", "linux", "arm64"), - PipelineBuild("ecr", "linux", "arm"), PipelineBuild("heroku", "linux", "amd64"), PipelineBuild("heroku", "linux", "arm64"), - PipelineBuild("heroku", "linux", "arm"), PipelineNotifications("docker"), PipelineNotifications("gcr"), PipelineNotifications("ecr"), diff --git a/.drone.yml b/.drone.yml index 6571ee8..bbc5514 100644 --- a/.drone.yml +++ b/.drone.yml @@ -175,80 +175,6 @@ trigger: depends_on: - testing ---- -kind: pipeline -name: linux-arm-docker - -platform: - os: linux - arch: arm - -steps: -- name: build-push - 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" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - - push - - pull_request - -- name: build-tag - 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" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - - tag - -- name: dryrun - pull: always - image: plugins/docker:linux-arm - settings: - dockerfile: docker/docker/Dockerfile.linux.arm - dry_run: true - password: - from_secret: docker_password - repo: plugins/docker - tags: linux-arm - username: - from_secret: docker_username - when: - event: - - pull_request - -- name: publish - pull: always - image: plugins/docker:linux-arm - settings: - auto_tag: true - auto_tag_suffix: linux-arm - dockerfile: docker/docker/Dockerfile.linux.arm - password: - from_secret: docker_password - repo: plugins/docker - username: - from_secret: docker_username - when: - event: - - push - - tag - -trigger: - branch: - - master - -depends_on: -- testing - --- kind: pipeline name: linux-amd64-gcr @@ -397,80 +323,6 @@ trigger: depends_on: - testing ---- -kind: pipeline -name: linux-arm-gcr - -platform: - os: linux - arch: arm - -steps: -- name: build-push - 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" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - - push - - pull_request - -- name: build-tag - 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" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - - tag - -- name: dryrun - pull: always - image: plugins/docker:linux-arm - settings: - dockerfile: docker/gcr/Dockerfile.linux.arm - dry_run: true - password: - from_secret: docker_password - repo: plugins/gcr - tags: linux-arm - username: - from_secret: docker_username - when: - event: - - pull_request - -- name: publish - pull: always - image: plugins/docker:linux-arm - settings: - auto_tag: true - auto_tag_suffix: linux-arm - dockerfile: docker/gcr/Dockerfile.linux.arm - password: - from_secret: docker_password - repo: plugins/gcr - username: - from_secret: docker_username - when: - event: - - push - - tag - -trigger: - branch: - - master - -depends_on: -- testing - --- kind: pipeline name: linux-amd64-ecr @@ -619,80 +471,6 @@ trigger: depends_on: - testing ---- -kind: pipeline -name: linux-arm-ecr - -platform: - os: linux - arch: arm - -steps: -- name: build-push - 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" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - - push - - pull_request - -- name: build-tag - 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" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - - tag - -- name: dryrun - pull: always - image: plugins/docker:linux-arm - settings: - dockerfile: docker/ecr/Dockerfile.linux.arm - dry_run: true - password: - from_secret: docker_password - repo: plugins/ecr - tags: linux-arm - username: - from_secret: docker_username - when: - event: - - pull_request - -- name: publish - pull: always - image: plugins/docker:linux-arm - settings: - auto_tag: true - auto_tag_suffix: linux-arm - dockerfile: docker/ecr/Dockerfile.linux.arm - password: - from_secret: docker_password - repo: plugins/ecr - username: - from_secret: docker_username - when: - event: - - push - - tag - -trigger: - branch: - - master - -depends_on: -- testing - --- kind: pipeline name: linux-amd64-heroku @@ -841,80 +619,6 @@ trigger: depends_on: - testing ---- -kind: pipeline -name: linux-arm-heroku - -platform: - os: linux - arch: arm - -steps: -- name: build-push - 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" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - - push - - pull_request - -- name: build-tag - 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" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - - tag - -- name: dryrun - pull: always - image: plugins/docker:linux-arm - settings: - dockerfile: docker/heroku/Dockerfile.linux.arm - dry_run: true - password: - from_secret: docker_password - repo: plugins/heroku - tags: linux-arm - username: - from_secret: docker_username - when: - event: - - pull_request - -- name: publish - pull: always - image: plugins/docker:linux-arm - settings: - auto_tag: true - auto_tag_suffix: linux-arm - dockerfile: docker/heroku/Dockerfile.linux.arm - password: - from_secret: docker_password - repo: plugins/heroku - username: - from_secret: docker_username - when: - event: - - push - - tag - -trigger: - branch: - - master - -depends_on: -- testing - --- kind: pipeline name: notifications-docker @@ -952,7 +656,6 @@ trigger: depends_on: - linux-amd64-docker - linux-arm64-docker -- linux-arm-docker --- kind: pipeline @@ -991,7 +694,6 @@ trigger: depends_on: - linux-amd64-gcr - linux-arm64-gcr -- linux-arm-gcr --- kind: pipeline @@ -1030,7 +732,6 @@ trigger: depends_on: - linux-amd64-ecr - linux-arm64-ecr -- linux-arm-ecr --- kind: pipeline @@ -1069,6 +770,5 @@ trigger: depends_on: - linux-amd64-heroku - linux-arm64-heroku -- linux-arm-heroku ... From f5ca41ec282d85d63d37c3014bd2c917d1ae1706 Mon Sep 17 00:00:00 2001 From: Thomas Boerger Date: Mon, 21 Jan 2019 09:31:48 +0100 Subject: [PATCH 09/16] Remove duplicated badge --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index cf4b8d9..5349d78 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,11 @@ [![Join the discussion at https://discourse.drone.io](https://img.shields.io/badge/discourse-forum-orange.svg)](https://discourse.drone.io) [![Drone questions at https://stackoverflow.com](https://img.shields.io/badge/drone-stackoverflow-orange.svg)](https://stackoverflow.com/questions/tagged/drone.io) [![](https://images.microbadger.com/badges/image/plugins/docker.svg)](https://microbadger.com/images/plugins/docker "Get your own image badge on microbadger.com") +[![](https://images.microbadger.com/badges/image/plugins/gcr.svg)](https://microbadger.com/images/plugins/gcr "Get your own image badge on microbadger.com") +[![](https://images.microbadger.com/badges/image/plugins/ecr.svg)](https://microbadger.com/images/plugins/ecr "Get your own image badge on microbadger.com") +[![](https://images.microbadger.com/badges/image/plugins/heroku.svg)](https://microbadger.com/images/plugins/heroku "Get your own image badge on microbadger.com") [![Go Doc](https://godoc.org/github.com/drone-plugins/drone-docker?status.svg)](http://godoc.org/github.com/drone-plugins/drone-docker) [![Go Report](https://goreportcard.com/badge/github.com/drone-plugins/drone-docker)](https://goreportcard.com/report/github.com/drone-plugins/drone-docker) -[![](https://images.microbadger.com/badges/image/plugins/docker.svg)](https://microbadger.com/images/plugins/docker "Get your own image badge on microbadger.com") Drone plugin to build and publish Docker images to a container registry. From 0ef41aa71930c29662a4a86396b1e44a9d084cbc Mon Sep 17 00:00:00 2001 From: Thomas Boerger Date: Mon, 21 Jan 2019 20:55:49 +0100 Subject: [PATCH 10/16] Add probot settings config --- .github/settings.yml | 69 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 .github/settings.yml diff --git a/.github/settings.yml b/.github/settings.yml new file mode 100644 index 0000000..3a43817 --- /dev/null +++ b/.github/settings.yml @@ -0,0 +1,69 @@ +repository: + name: drone-docker + description: Drone plugin for publishing Docker images + homepage: http://plugins.drone.io/drone-plugins/drone-docker + topics: drone, drone-plugin + + private: false + has_issues: true + has_wiki: false + has_downloads: false + + default_branch: master + + allow_squash_merge: true + allow_merge_commit: true + allow_rebase_merge: true + +labels: + - name: bug + color: d73a4a + description: Something isn't working + - name: duplicate + color: cfd3d7 + description: This issue or pull request already exists + - name: enhancement + color: a2eeef + description: New feature or request + - name: good first issue + color: 7057ff + description: Good for newcomers + - name: help wanted + color: 008672 + description: Extra attention is needed + - name: invalid + color: e4e669 + description: This doesn't seem right + - name: question + color: d876e3 + description: Further information is requested + - name: renovate + color: e99695 + description: Automated action from Renovate + - name: wontfix + color: ffffff + description: This will not be worked on + +teams: + - name: Admins + permission: admin + +branches: + - name: master + protection: + required_pull_request_reviews: + required_approving_review_count: 1 + dismiss_stale_reviews: false + require_code_owner_reviews: false + dismissal_restrictions: + teams: + - Admins + - Captain + required_status_checks: + strict: true + contexts: + - continuous-integration/drone/pr + enforce_admins: false + restrictions: + users: [] + teams: [] From b782db068fe7107201ded90b53abffd016ad6faa Mon Sep 17 00:00:00 2001 From: Thomas Boerger Date: Mon, 21 Jan 2019 21:02:08 +0100 Subject: [PATCH 11/16] Add some basic issue template content --- .github/issue_template.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/issue_template.md b/.github/issue_template.md index e69cc9a..3f95605 100644 --- a/.github/issue_template.md +++ b/.github/issue_template.md @@ -4,6 +4,6 @@ Bugs or Issues? Due to the high number of false positive issues we receive, please do not create a GitHub issue until you have discussed and verified with community support at: - https://discourse.drone.io + https://discourse.drone.io/ --> From 2ca0313b38c73085cc2ada2820d2622349dd7b2d Mon Sep 17 00:00:00 2001 From: Thomas Boerger Date: Mon, 21 Jan 2019 21:17:12 +0100 Subject: [PATCH 12/16] Add arm docker images and fix pipeline dependencies --- .drone.jsonnet | 7 +- .drone.yml | 312 ++++++++++++++++++++++++++++- docker/Dockerfile.arm | 5 +- docker/Dockerfile.arm64 | 2 +- docker/ecr/Dockerfile.linux.arm | 4 + docker/gcr/Dockerfile.linux.arm | 4 + docker/heroku/Dockerfile | 2 +- docker/heroku/Dockerfile.linux.arm | 4 + 8 files changed, 330 insertions(+), 10 deletions(-) create mode 100644 docker/ecr/Dockerfile.linux.arm create mode 100644 docker/gcr/Dockerfile.linux.arm create mode 100644 docker/heroku/Dockerfile.linux.arm diff --git a/.drone.jsonnet b/.drone.jsonnet index 4a9268f..0c7a854 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -106,7 +106,7 @@ local PipelineBuild(binary="docker", os="linux", arch="amd64") = { }, ], depends_on: [ - "testing", + if binary == "docker" then "testing" else os + "-" + arch + "-docker", ], trigger: { branch: [ "master" ], @@ -144,6 +144,7 @@ local PipelineNotifications(binary="docker") = { depends_on: [ "linux-amd64-" + binary, "linux-arm64-" + binary, + "linux-arm-" + binary, ], trigger: { branch: [ "master" ], @@ -155,12 +156,16 @@ local PipelineNotifications(binary="docker") = { PipelineTesting, PipelineBuild("docker", "linux", "amd64"), PipelineBuild("docker", "linux", "arm64"), + PipelineBuild("docker", "linux", "arm"), PipelineBuild("gcr", "linux", "amd64"), PipelineBuild("gcr", "linux", "arm64"), + PipelineBuild("gcr", "linux", "arm"), PipelineBuild("ecr", "linux", "amd64"), PipelineBuild("ecr", "linux", "arm64"), + PipelineBuild("ecr", "linux", "arm"), PipelineBuild("heroku", "linux", "amd64"), PipelineBuild("heroku", "linux", "arm64"), + PipelineBuild("heroku", "linux", "arm"), PipelineNotifications("docker"), PipelineNotifications("gcr"), PipelineNotifications("ecr"), diff --git a/.drone.yml b/.drone.yml index bbc5514..69226f2 100644 --- a/.drone.yml +++ b/.drone.yml @@ -175,6 +175,80 @@ trigger: depends_on: - testing +--- +kind: pipeline +name: linux-arm-docker + +platform: + os: linux + arch: arm + +steps: +- name: build-push + 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" + environment: + CGO_ENABLED: 0 + GO111MODULE: on + when: + event: + - push + - pull_request + +- name: build-tag + 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" + environment: + CGO_ENABLED: 0 + GO111MODULE: on + when: + event: + - tag + +- name: dryrun + pull: always + image: plugins/docker:linux-arm + settings: + dockerfile: docker/docker/Dockerfile.linux.arm + dry_run: true + password: + from_secret: docker_password + repo: plugins/docker + tags: linux-arm + username: + from_secret: docker_username + when: + event: + - pull_request + +- name: publish + pull: always + image: plugins/docker:linux-arm + settings: + auto_tag: true + auto_tag_suffix: linux-arm + dockerfile: docker/docker/Dockerfile.linux.arm + password: + from_secret: docker_password + repo: plugins/docker + username: + from_secret: docker_username + when: + event: + - push + - tag + +trigger: + branch: + - master + +depends_on: +- testing + --- kind: pipeline name: linux-amd64-gcr @@ -247,7 +321,7 @@ trigger: - master depends_on: -- testing +- linux-amd64-docker --- kind: pipeline @@ -321,7 +395,81 @@ trigger: - master depends_on: -- testing +- linux-arm64-docker + +--- +kind: pipeline +name: linux-arm-gcr + +platform: + os: linux + arch: arm + +steps: +- name: build-push + 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" + environment: + CGO_ENABLED: 0 + GO111MODULE: on + when: + event: + - push + - pull_request + +- name: build-tag + 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" + environment: + CGO_ENABLED: 0 + GO111MODULE: on + when: + event: + - tag + +- name: dryrun + pull: always + image: plugins/docker:linux-arm + settings: + dockerfile: docker/gcr/Dockerfile.linux.arm + dry_run: true + password: + from_secret: docker_password + repo: plugins/gcr + tags: linux-arm + username: + from_secret: docker_username + when: + event: + - pull_request + +- name: publish + pull: always + image: plugins/docker:linux-arm + settings: + auto_tag: true + auto_tag_suffix: linux-arm + dockerfile: docker/gcr/Dockerfile.linux.arm + password: + from_secret: docker_password + repo: plugins/gcr + username: + from_secret: docker_username + when: + event: + - push + - tag + +trigger: + branch: + - master + +depends_on: +- linux-arm-docker --- kind: pipeline @@ -395,7 +543,7 @@ trigger: - master depends_on: -- testing +- linux-amd64-docker --- kind: pipeline @@ -469,7 +617,81 @@ trigger: - master depends_on: -- testing +- linux-arm64-docker + +--- +kind: pipeline +name: linux-arm-ecr + +platform: + os: linux + arch: arm + +steps: +- name: build-push + 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" + environment: + CGO_ENABLED: 0 + GO111MODULE: on + when: + event: + - push + - pull_request + +- name: build-tag + 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" + environment: + CGO_ENABLED: 0 + GO111MODULE: on + when: + event: + - tag + +- name: dryrun + pull: always + image: plugins/docker:linux-arm + settings: + dockerfile: docker/ecr/Dockerfile.linux.arm + dry_run: true + password: + from_secret: docker_password + repo: plugins/ecr + tags: linux-arm + username: + from_secret: docker_username + when: + event: + - pull_request + +- name: publish + pull: always + image: plugins/docker:linux-arm + settings: + auto_tag: true + auto_tag_suffix: linux-arm + dockerfile: docker/ecr/Dockerfile.linux.arm + password: + from_secret: docker_password + repo: plugins/ecr + username: + from_secret: docker_username + when: + event: + - push + - tag + +trigger: + branch: + - master + +depends_on: +- linux-arm-docker --- kind: pipeline @@ -543,7 +765,7 @@ trigger: - master depends_on: -- testing +- linux-amd64-docker --- kind: pipeline @@ -617,7 +839,81 @@ trigger: - master depends_on: -- testing +- linux-arm64-docker + +--- +kind: pipeline +name: linux-arm-heroku + +platform: + os: linux + arch: arm + +steps: +- name: build-push + 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" + environment: + CGO_ENABLED: 0 + GO111MODULE: on + when: + event: + - push + - pull_request + +- name: build-tag + 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" + environment: + CGO_ENABLED: 0 + GO111MODULE: on + when: + event: + - tag + +- name: dryrun + pull: always + image: plugins/docker:linux-arm + settings: + dockerfile: docker/heroku/Dockerfile.linux.arm + dry_run: true + password: + from_secret: docker_password + repo: plugins/heroku + tags: linux-arm + username: + from_secret: docker_username + when: + event: + - pull_request + +- name: publish + pull: always + image: plugins/docker:linux-arm + settings: + auto_tag: true + auto_tag_suffix: linux-arm + dockerfile: docker/heroku/Dockerfile.linux.arm + password: + from_secret: docker_password + repo: plugins/heroku + username: + from_secret: docker_username + when: + event: + - push + - tag + +trigger: + branch: + - master + +depends_on: +- linux-arm-docker --- kind: pipeline @@ -656,6 +952,7 @@ trigger: depends_on: - linux-amd64-docker - linux-arm64-docker +- linux-arm-docker --- kind: pipeline @@ -694,6 +991,7 @@ trigger: depends_on: - linux-amd64-gcr - linux-arm64-gcr +- linux-arm-gcr --- kind: pipeline @@ -732,6 +1030,7 @@ trigger: depends_on: - linux-amd64-ecr - linux-arm64-ecr +- linux-arm-ecr --- kind: pipeline @@ -770,5 +1069,6 @@ trigger: depends_on: - linux-amd64-heroku - linux-arm64-heroku +- linux-arm-heroku ... diff --git a/docker/Dockerfile.arm b/docker/Dockerfile.arm index b8e4bb0..310f16a 100644 --- a/docker/Dockerfile.arm +++ b/docker/Dockerfile.arm @@ -1 +1,4 @@ -# see https://github.com/docker-library/docker/issues/67 +FROM docker:18.06-dind + +ADD release/linux/arm/drone-docker /bin/ +ENTRYPOINT ["/usr/local/bin/dockerd-entrypoint.sh", "/bin/drone-docker"] diff --git a/docker/Dockerfile.arm64 b/docker/Dockerfile.arm64 index 502fb4c..5fd6f01 100644 --- a/docker/Dockerfile.arm64 +++ b/docker/Dockerfile.arm64 @@ -1,4 +1,4 @@ -FROM arm64v8/docker:18.06-dind +FROM docker:18.06-dind ADD release/linux/arm64/drone-docker /bin/ ENTRYPOINT ["/usr/local/bin/dockerd-entrypoint.sh", "/bin/drone-docker"] diff --git a/docker/ecr/Dockerfile.linux.arm b/docker/ecr/Dockerfile.linux.arm new file mode 100644 index 0000000..f8dd9e3 --- /dev/null +++ b/docker/ecr/Dockerfile.linux.arm @@ -0,0 +1,4 @@ +FROM plugins/docker:linux-arm + +ADD release/linux/arm/drone-ecr /bin/ +ENTRYPOINT ["/usr/local/bin/dockerd-entrypoint.sh", "/bin/drone-ecr"] diff --git a/docker/gcr/Dockerfile.linux.arm b/docker/gcr/Dockerfile.linux.arm new file mode 100644 index 0000000..718ce0f --- /dev/null +++ b/docker/gcr/Dockerfile.linux.arm @@ -0,0 +1,4 @@ +FROM plugins/docker:linux-arm + +ADD release/linux/arm/drone-gcr /bin/ +ENTRYPOINT ["/usr/local/bin/dockerd-entrypoint.sh", "/bin/drone-gcr"] diff --git a/docker/heroku/Dockerfile b/docker/heroku/Dockerfile index c06cdb6..e2e7e52 100644 --- a/docker/heroku/Dockerfile +++ b/docker/heroku/Dockerfile @@ -1,4 +1,4 @@ -FROM plugins/docker:latest +FROM plugins/docker:linux-amd64 ADD release/linux/amd64/drone-heroku /bin/ ENTRYPOINT ["/usr/local/bin/dockerd-entrypoint.sh", "/bin/drone-heroku"] diff --git a/docker/heroku/Dockerfile.linux.arm b/docker/heroku/Dockerfile.linux.arm new file mode 100644 index 0000000..b233cca --- /dev/null +++ b/docker/heroku/Dockerfile.linux.arm @@ -0,0 +1,4 @@ +FROM plugins/docker:linux-arm + +ADD release/linux/arm/drone-heroku /bin/ +ENTRYPOINT ["/usr/local/bin/dockerd-entrypoint.sh", "/bin/drone-heroku"] From 505ce222b8311973ed0b34e52ead11c2830e0847 Mon Sep 17 00:00:00 2001 From: Thomas Boerger Date: Mon, 21 Jan 2019 21:33:14 +0100 Subject: [PATCH 13/16] Only display docker badge, otherwise there are too much --- README.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/README.md b/README.md index 5349d78..6debd57 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,6 @@ [![Join the discussion at https://discourse.drone.io](https://img.shields.io/badge/discourse-forum-orange.svg)](https://discourse.drone.io) [![Drone questions at https://stackoverflow.com](https://img.shields.io/badge/drone-stackoverflow-orange.svg)](https://stackoverflow.com/questions/tagged/drone.io) [![](https://images.microbadger.com/badges/image/plugins/docker.svg)](https://microbadger.com/images/plugins/docker "Get your own image badge on microbadger.com") -[![](https://images.microbadger.com/badges/image/plugins/gcr.svg)](https://microbadger.com/images/plugins/gcr "Get your own image badge on microbadger.com") -[![](https://images.microbadger.com/badges/image/plugins/ecr.svg)](https://microbadger.com/images/plugins/ecr "Get your own image badge on microbadger.com") -[![](https://images.microbadger.com/badges/image/plugins/heroku.svg)](https://microbadger.com/images/plugins/heroku "Get your own image badge on microbadger.com") [![Go Doc](https://godoc.org/github.com/drone-plugins/drone-docker?status.svg)](http://godoc.org/github.com/drone-plugins/drone-docker) [![Go Report](https://goreportcard.com/badge/github.com/drone-plugins/drone-docker)](https://goreportcard.com/report/github.com/drone-plugins/drone-docker) From 012d26f30f1d93e9b6f3aa56c694d47e86527807 Mon Sep 17 00:00:00 2001 From: Thomas Boerger Date: Mon, 21 Jan 2019 21:48:42 +0100 Subject: [PATCH 14/16] Fix microbadger secret reference --- .drone.jsonnet | 2 +- .drone.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.drone.jsonnet b/.drone.jsonnet index 0c7a854..ea298c0 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -137,7 +137,7 @@ local PipelineNotifications(binary="docker") = { image: "plugins/webhook:1", pull: "always", settings: { - url: { "from_secret": "microbadger_docker" }, + url: { "from_secret": "microbadger_" + binary }, }, }, ], diff --git a/.drone.yml b/.drone.yml index 69226f2..1af8690 100644 --- a/.drone.yml +++ b/.drone.yml @@ -979,7 +979,7 @@ steps: image: plugins/webhook:1 settings: url: - from_secret: microbadger_docker + from_secret: microbadger_gcr trigger: branch: @@ -1018,7 +1018,7 @@ steps: image: plugins/webhook:1 settings: url: - from_secret: microbadger_docker + from_secret: microbadger_ecr trigger: branch: @@ -1057,7 +1057,7 @@ steps: image: plugins/webhook:1 settings: url: - from_secret: microbadger_docker + from_secret: microbadger_heroku trigger: branch: From 797ada9b21439f92efe6fd1376cb92e0c2c31ccc Mon Sep 17 00:00:00 2001 From: Thomas Boerger Date: Mon, 21 Jan 2019 21:55:07 +0100 Subject: [PATCH 15/16] Rebased to master and applied rename again --- docker/{Dockerfile => docker/Dockerfile.linux.amd64} | 0 docker/{Dockerfile.arm => docker/Dockerfile.linux.arm} | 0 docker/{Dockerfile.arm64 => docker/Dockerfile.linux.arm64} | 0 docker/ecr/Dockerfile.arm | 4 ---- docker/ecr/{Dockerfile => Dockerfile.linux.amd64} | 0 docker/ecr/{Dockerfile.arm64 => Dockerfile.linux.arm64} | 0 docker/gcr/Dockerfile.arm | 4 ---- docker/gcr/{Dockerfile => Dockerfile.linux.amd64} | 0 docker/gcr/{Dockerfile.arm64 => Dockerfile.linux.arm64} | 0 docker/heroku/Dockerfile.arm | 4 ---- docker/heroku/{Dockerfile => Dockerfile.linux.amd64} | 0 docker/heroku/{Dockerfile.arm64 => Dockerfile.linux.arm64} | 0 12 files changed, 12 deletions(-) rename docker/{Dockerfile => docker/Dockerfile.linux.amd64} (100%) rename docker/{Dockerfile.arm => docker/Dockerfile.linux.arm} (100%) rename docker/{Dockerfile.arm64 => docker/Dockerfile.linux.arm64} (100%) delete mode 100644 docker/ecr/Dockerfile.arm rename docker/ecr/{Dockerfile => Dockerfile.linux.amd64} (100%) rename docker/ecr/{Dockerfile.arm64 => Dockerfile.linux.arm64} (100%) delete mode 100644 docker/gcr/Dockerfile.arm rename docker/gcr/{Dockerfile => Dockerfile.linux.amd64} (100%) rename docker/gcr/{Dockerfile.arm64 => Dockerfile.linux.arm64} (100%) delete mode 100644 docker/heroku/Dockerfile.arm rename docker/heroku/{Dockerfile => Dockerfile.linux.amd64} (100%) rename docker/heroku/{Dockerfile.arm64 => Dockerfile.linux.arm64} (100%) diff --git a/docker/Dockerfile b/docker/docker/Dockerfile.linux.amd64 similarity index 100% rename from docker/Dockerfile rename to docker/docker/Dockerfile.linux.amd64 diff --git a/docker/Dockerfile.arm b/docker/docker/Dockerfile.linux.arm similarity index 100% rename from docker/Dockerfile.arm rename to docker/docker/Dockerfile.linux.arm diff --git a/docker/Dockerfile.arm64 b/docker/docker/Dockerfile.linux.arm64 similarity index 100% rename from docker/Dockerfile.arm64 rename to docker/docker/Dockerfile.linux.arm64 diff --git a/docker/ecr/Dockerfile.arm b/docker/ecr/Dockerfile.arm deleted file mode 100644 index b36ba35..0000000 --- a/docker/ecr/Dockerfile.arm +++ /dev/null @@ -1,4 +0,0 @@ -FROM plugins/docker:linux-arm - -ADD release/linux/arm64/drone-docker-ecr /bin/ -ENTRYPOINT ["/usr/local/bin/dockerd-entrypoint.sh", "/bin/drone-docker-ecr"] diff --git a/docker/ecr/Dockerfile b/docker/ecr/Dockerfile.linux.amd64 similarity index 100% rename from docker/ecr/Dockerfile rename to docker/ecr/Dockerfile.linux.amd64 diff --git a/docker/ecr/Dockerfile.arm64 b/docker/ecr/Dockerfile.linux.arm64 similarity index 100% rename from docker/ecr/Dockerfile.arm64 rename to docker/ecr/Dockerfile.linux.arm64 diff --git a/docker/gcr/Dockerfile.arm b/docker/gcr/Dockerfile.arm deleted file mode 100644 index 5d45caf..0000000 --- a/docker/gcr/Dockerfile.arm +++ /dev/null @@ -1,4 +0,0 @@ -FROM plugins/docker:linux-arm - -ADD release/linux/arm64/drone-docker-gcr /bin/ -ENTRYPOINT ["/usr/local/bin/dockerd-entrypoint.sh", "/bin/drone-docker-gcr"] diff --git a/docker/gcr/Dockerfile b/docker/gcr/Dockerfile.linux.amd64 similarity index 100% rename from docker/gcr/Dockerfile rename to docker/gcr/Dockerfile.linux.amd64 diff --git a/docker/gcr/Dockerfile.arm64 b/docker/gcr/Dockerfile.linux.arm64 similarity index 100% rename from docker/gcr/Dockerfile.arm64 rename to docker/gcr/Dockerfile.linux.arm64 diff --git a/docker/heroku/Dockerfile.arm b/docker/heroku/Dockerfile.arm deleted file mode 100644 index e521b02..0000000 --- a/docker/heroku/Dockerfile.arm +++ /dev/null @@ -1,4 +0,0 @@ -FROM plugins/docker:linux-arm - -ADD release/linux/arm/drone-docker-heroku /bin/ -ENTRYPOINT ["/usr/local/bin/dockerd-entrypoint.sh", "/bin/drone-docker-heroku"] diff --git a/docker/heroku/Dockerfile b/docker/heroku/Dockerfile.linux.amd64 similarity index 100% rename from docker/heroku/Dockerfile rename to docker/heroku/Dockerfile.linux.amd64 diff --git a/docker/heroku/Dockerfile.arm64 b/docker/heroku/Dockerfile.linux.arm64 similarity index 100% rename from docker/heroku/Dockerfile.arm64 rename to docker/heroku/Dockerfile.linux.arm64 From 3ca350a16fa61e5d469b8db47689235493402168 Mon Sep 17 00:00:00 2001 From: Thomas Boerger Date: Tue, 22 Jan 2019 09:37:27 +0100 Subject: [PATCH 16/16] Make sure to use the right base image built before --- docker/docker/Dockerfile.linux.amd64 | 4 +--- docker/ecr/Dockerfile.linux.amd64 | 2 +- docker/gcr/Dockerfile.linux.amd64 | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/docker/docker/Dockerfile.linux.amd64 b/docker/docker/Dockerfile.linux.amd64 index 8ada790..02b6fff 100644 --- a/docker/docker/Dockerfile.linux.amd64 +++ b/docker/docker/Dockerfile.linux.amd64 @@ -1,6 +1,4 @@ -# docker build --rm -f docker/Dockerfile -t plugins/docker . - -FROM docker:17.12.0-ce-dind +FROM docker:18.06-dind ADD release/linux/amd64/drone-docker /bin/ ENTRYPOINT ["/usr/local/bin/dockerd-entrypoint.sh", "/bin/drone-docker"] diff --git a/docker/ecr/Dockerfile.linux.amd64 b/docker/ecr/Dockerfile.linux.amd64 index d941387..5f7ab8b 100644 --- a/docker/ecr/Dockerfile.linux.amd64 +++ b/docker/ecr/Dockerfile.linux.amd64 @@ -1,4 +1,4 @@ -FROM plugins/docker:latest +FROM plugins/docker:linux-amd64 ADD release/linux/amd64/drone-ecr /bin/ ENTRYPOINT ["/usr/local/bin/dockerd-entrypoint.sh", "/bin/drone-ecr"] diff --git a/docker/gcr/Dockerfile.linux.amd64 b/docker/gcr/Dockerfile.linux.amd64 index e982ef9..b756e04 100644 --- a/docker/gcr/Dockerfile.linux.amd64 +++ b/docker/gcr/Dockerfile.linux.amd64 @@ -1,4 +1,4 @@ -FROM plugins/docker:latest +FROM plugins/docker:linux-amd64 ADD release/linux/amd64/drone-gcr /bin/ ENTRYPOINT ["/usr/local/bin/dockerd-entrypoint.sh", "/bin/drone-gcr"]