From bb94127aa6d52180b3e13139d3e0e9825f2e3ee5 Mon Sep 17 00:00:00 2001 From: Thomas Boerger Date: Sun, 20 Jan 2019 23:51:59 +0100 Subject: [PATCH] Migrate configs to drone 1.0.0 and drop appveyor --- .drone.jsonnet | 404 ++++++++++++++++++++ .drone.sh | 24 -- .drone.windows.yml | 244 ++++++++++++ .drone.yml | 912 ++++++++++++++++++++++++++++++++++++++++++--- 4 files changed, 1511 insertions(+), 73 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 - -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 - - publish: - image: plugins/docker +--- +kind: pipeline +name: testing + +platform: + os: linux + arch: amd64 + +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: 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 - tags: [ "latest", "17", "17.12" ] - secrets: [ docker_username, docker_password ] - dockerfile: docker/Dockerfile - when: - branch: master - event: push - - publish_heroku: - image: 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 - tags: [ "latest", "17", "17.12" ] - secrets: [ docker_username, docker_password ] - dockerfile: docker/heroku/Dockerfile - when: - branch: master - event: push - - publish_gcr: - image: plugins/docker + 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 - - publish_ecr: - image: plugins/docker + 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: [ "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 + +...