diff --git a/.drone.star b/.drone.star new file mode 100644 index 0000000..054074f --- /dev/null +++ b/.drone.star @@ -0,0 +1,279 @@ +golang_image = "golang:1.15" + +def main(ctx): + before = testing(ctx) + + stages = [ + linux(ctx, "amd64"), + linux(ctx, "arm64"), + linux(ctx, "arm"), + ] + + after = manifest(ctx) + gitter(ctx) + + for b in before: + for s in stages: + s["depends_on"].append(b["name"]) + + for s in stages: + for a in after: + a["depends_on"].append(s["name"]) + + return before + stages + after + +def testing(ctx): + step_volumes = [ + { + "name": "gopath", + "path": "/go", + }, + ] + + return [ + { + "kind": "pipeline", + "type": "docker", + "name": "testing", + "platform": { + "os": "linux", + "arch": "amd64", + }, + "steps": [ + { + "name": "staticcheck", + "image": golang_image, + "pull": "always", + "commands": [ + "go run honnef.co/go/tools/cmd/staticcheck ./...", + ], + "volumes": step_volumes, + }, + { + "name": "lint", + "image": golang_image, + "pull": "always", + "commands": [ + "go run golang.org/x/lint/golint -set_exit_status ./...", + ], + "volumes": step_volumes, + }, + { + "name": "vet", + "image": golang_image, + "commands": [ + "go vet ./...", + ], + "volumes": step_volumes, + }, + { + "name": "test", + "image": golang_image, + "commands": [ + "go test -cover ./...", + ], + "volumes": step_volumes, + }, + ], + "volumes": [ + { + "name": "gopath", + "temp": {}, + }, + ], + "trigger": { + "ref": [ + "refs/heads/master", + "refs/tags/**", + "refs/pull/**", + ], + }, + }, + ] + +def linux(ctx, arch): + steps = [ + { + "name": "environment", + "image": golang_image, + "pull": "always", + "environment": { + "CGO_ENABLED": "0", + }, + "commands": [ + "go version", + "go env", + ], + }, + ] + + steps.extend(linux_build(ctx, arch, "docker")) + steps.extend(linux_build(ctx, arch, "acr")) + steps.extend(linux_build(ctx, arch, "ecr")) + steps.extend(linux_build(ctx, arch, "gcr")) + steps.extend(linux_build(ctx, arch, "heroku")) + + return { + "kind": "pipeline", + "type": "docker", + "name": "linux-%s" % (arch), + "platform": { + "os": "linux", + "arch": arch, + }, + "steps": steps, + "depends_on": [], + "trigger": { + "ref": [ + "refs/heads/master", + "refs/tags/**", + "refs/pull/**", + ], + }, + } + +def linux_build(ctx, arch, name): + docker = { + "dockerfile": "docker/%s/Dockerfile.linux.%s" % (name, arch), + "repo": "plugins/%s" % (name), + "username": { + "from_secret": "docker_username", + }, + "password": { + "from_secret": "docker_password", + }, + } + + if ctx.build.event == "pull_request": + docker.update({ + "dry_run": True, + "tags": "linux-%s" % (arch), + }) + else: + docker.update({ + "auto_tag": True, + "auto_tag_suffix": "linux-%s" % (arch), + }) + + if ctx.build.event == "tag": + build = [ + 'go build -v -ldflags "-X main.version=%s" -a -tags netgo -o release/linux/%s/drone-npm ./cmd/drone-npm' % (ctx.build.ref.replace("refs/tags/v", ""), arch), + ] + else: + build = [ + 'go build -v -ldflags "-X main.version=%s" -a -tags netgo -o release/linux/%s/drone-npm ./cmd/drone-npm' % (ctx.build.commit[0:8], arch), + ] + + return [ + { + "name": "build-%s" % (name), + "image": golang_image, + "environment": { + "CGO_ENABLED": "0", + }, + "commands": build, + }, + { + "name": "executable-%s" % (name), + "image": golang_image, + "commands": [ + "./release/linux/%s/drone-%s --help" % (arch, name), + ], + }, + { + "name": "docker-%s" % (name), + "image": "plugins/docker", + "pull": "always", + "settings": docker, + }, + ] + +def manifest(ctx): + steps = [] + + steps.extend(manifest_build(ctx, "docker")) + steps.extend(manifest_build(ctx, "acr")) + steps.extend(manifest_build(ctx, "ecr")) + steps.extend(manifest_build(ctx, "gcr")) + steps.extend(manifest_build(ctx, "heroku")) + + return [ + { + "kind": "pipeline", + "type": "docker", + "name": "manifest", + "steps": steps, + "depends_on": [], + "trigger": { + "ref": [ + "refs/heads/master", + "refs/tags/**", + ], + }, + }, + ] + +def manifest_build(ctx, name): + return [ + { + "name": "manifest-%s" % (name), + "image": "plugins/manifest", + "pull": "always", + "settings": { + "auto_tag": "true", + "username": { + "from_secret": "docker_username", + }, + "password": { + "from_secret": "docker_password", + }, + "spec": "docker/%s/manifest.tmpl" % (name), + "ignore_missing": "true", + }, + }, + { + "name": "microbadger-%s" % (name), + "image": "plugins/webhook", + "pull": "always", + "settings": { + "urls": { + "from_secret": "microbadger_url", + }, + }, + }, + ] + +def gitter(ctx): + return [ + { + "kind": "pipeline", + "type": "docker", + "name": "gitter", + "clone": { + "disable": True, + }, + "steps": [ + { + "name": "gitter", + "image": "plugins/gitter", + "pull": "always", + "settings": { + "webhook": { + "from_secret": "gitter_webhook", + }, + }, + }, + ], + "depends_on": [ + "manifest", + ], + "trigger": { + "ref": [ + "refs/heads/master", + "refs/tags/**", + ], + "status": [ + "failure", + ], + }, + }, + ] diff --git a/.drone.yml b/.drone.yml index 42e712a..a39d695 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,5 +1,6 @@ --- kind: pipeline +type: docker name: testing platform: @@ -7,24 +8,36 @@ platform: arch: amd64 steps: -- name: vet +- name: staticcheck pull: always - image: golang:1.11 + image: golang:1.15 + commands: + - go run honnef.co/go/tools/cmd/staticcheck ./... + volumes: + - name: gopath + path: /go + +- name: lint + pull: always + image: golang:1.15 + commands: + - go run golang.org/x/lint/golint -set_exit_status ./... + volumes: + - name: gopath + path: /go + +- name: vet + image: golang:1.15 commands: - go vet ./... - environment: - GO111MODULE: on volumes: - name: gopath path: /go - name: test - pull: always - image: golang:1.11 + image: golang:1.15 commands: - go test -cover ./... - environment: - GO111MODULE: on volumes: - name: gopath path: /go @@ -36,385 +49,479 @@ volumes: trigger: ref: - refs/heads/master - - "refs/tags/**" - - "refs/pull/**" + - refs/tags/** + - refs/pull/** --- kind: pipeline -type: ssh -name: windows-1809-amd64-docker - -platform: - os: windows - -server: - host: windows.1809.amd64.plugins.drone.ci - password: - from_secret: windows_password - user: - from_secret: windows_username - -steps: -- name: build - commands: - # TODO use the new DRONE_SEMVER_SHORT environment variables to - # publish docker images for tag events. - - go build -o release/windows/amd64/drone-docker.exe ./cmd/drone-docker - - docker login -u $env:USERNAME -p $env:PASSWORD - - docker build -f docker/docker/Dockerfile.windows.1809 -t plugins/docker:windows-1809-amd64 . - - docker push plugins/docker:windows-1809-amd64 - environment: - CGO_ENABLED: "0" - USERNAME: - from_secret: docker_username - PASSWORD: - from_secret: docker_password - -trigger: - event: - - push - -depends_on: -- testing - ---- -kind: pipeline -type: ssh -name: windows-1903-amd64-docker - -platform: - os: windows - -server: - host: windows.1903.amd64.plugins.drone.ci - password: - from_secret: windows_password - user: - from_secret: windows_username - -steps: -- name: build - commands: - # TODO use the new DRONE_SEMVER_SHORT environment variables to - # publish docker images for tag events. - - go build -o release/windows/amd64/drone-docker.exe ./cmd/drone-docker - - docker login -u $env:USERNAME -p $env:PASSWORD - - docker build -f docker/docker/Dockerfile.windows.1903 -t plugins/docker:windows-1903-amd64 . - - docker push plugins/docker:windows-1903-amd64 - environment: - CGO_ENABLED: "0" - USERNAME: - from_secret: docker_username - PASSWORD: - from_secret: docker_password - -trigger: - event: - - push - -depends_on: -- testing - ---- -kind: pipeline -type: ssh -name: windows-1909-amd64-docker - -platform: - os: windows - -server: - host: windows.1909.amd64.plugins.drone.ci - password: - from_secret: windows_password - user: - from_secret: windows_username - -steps: - - name: build - commands: - # TODO use the new DRONE_SEMVER_SHORT environment variables to - # publish docker images for tag events. - - go build -o release/windows/amd64/drone-docker.exe ./cmd/drone-docker - - docker login -u $env:USERNAME -p $env:PASSWORD - - docker build -f docker/docker/Dockerfile.windows.1909 -t plugins/docker:windows-1909-amd64 . - - docker push plugins/docker:windows-1909-amd64 - environment: - CGO_ENABLED: "0" - USERNAME: - from_secret: docker_username - PASSWORD: - from_secret: docker_password - -trigger: - event: - - push - -depends_on: - - testing - ---- -kind: pipeline -name: linux-amd64-docker +type: docker +name: linux-amd64 platform: os: linux arch: amd64 steps: -- name: build-push +- name: environment pull: always - image: golang:1.11 + image: golang:1.15 commands: - - "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/linux/amd64/drone-docker ./cmd/drone-docker" + - go version + - go env environment: CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - exclude: - - tag -- name: build-tag - pull: always - image: golang:1.11 +- name: build-docker + image: golang:1.15 commands: - - "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/linux/amd64/drone-docker ./cmd/drone-docker" + - go build -v -ldflags "-X main.version=" -a -tags netgo -o release/linux/amd64/drone-npm ./cmd/drone-npm environment: CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - - tag -- name: executable - pull: always - image: golang:1.11 +- name: executable-docker + image: golang:1.15 commands: - ./release/linux/amd64/drone-docker --help -- name: dryrun +- name: docker-docker pull: always - image: plugins/docker:18 - settings: - daemon_off: false - 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 - pull: always - image: plugins/docker:18 + image: plugins/docker settings: auto_tag: true auto_tag_suffix: linux-amd64 - daemon_off: false dockerfile: docker/docker/Dockerfile.linux.amd64 password: from_secret: docker_password repo: plugins/docker username: from_secret: docker_username - when: - event: - exclude: - - pull_request + +- name: build-acr + image: golang:1.15 + commands: + - go build -v -ldflags "-X main.version=" -a -tags netgo -o release/linux/amd64/drone-npm ./cmd/drone-npm + environment: + CGO_ENABLED: 0 + +- name: executable-acr + image: golang:1.15 + commands: + - ./release/linux/amd64/drone-acr --help + +- name: docker-acr + pull: always + image: plugins/docker + settings: + auto_tag: true + auto_tag_suffix: linux-amd64 + dockerfile: docker/acr/Dockerfile.linux.amd64 + password: + from_secret: docker_password + repo: plugins/acr + username: + from_secret: docker_username + +- name: build-ecr + image: golang:1.15 + commands: + - go build -v -ldflags "-X main.version=" -a -tags netgo -o release/linux/amd64/drone-npm ./cmd/drone-npm + environment: + CGO_ENABLED: 0 + +- name: executable-ecr + image: golang:1.15 + commands: + - ./release/linux/amd64/drone-ecr --help + +- name: docker-ecr + pull: always + image: plugins/docker + 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 + +- name: build-gcr + image: golang:1.15 + commands: + - go build -v -ldflags "-X main.version=" -a -tags netgo -o release/linux/amd64/drone-npm ./cmd/drone-npm + environment: + CGO_ENABLED: 0 + +- name: executable-gcr + image: golang:1.15 + commands: + - ./release/linux/amd64/drone-gcr --help + +- name: docker-gcr + pull: always + image: plugins/docker + 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 + +- name: build-heroku + image: golang:1.15 + commands: + - go build -v -ldflags "-X main.version=" -a -tags netgo -o release/linux/amd64/drone-npm ./cmd/drone-npm + environment: + CGO_ENABLED: 0 + +- name: executable-heroku + image: golang:1.15 + commands: + - ./release/linux/amd64/drone-heroku --help + +- name: docker-heroku + pull: always + image: plugins/docker + 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 trigger: ref: - refs/heads/master - - "refs/tags/**" - - "refs/pull/**" + - refs/tags/** + - refs/pull/** depends_on: - testing --- kind: pipeline -name: linux-arm64-docker +type: docker +name: linux-arm64 platform: os: linux arch: arm64 steps: -- name: build-push +- name: environment pull: always - image: golang:1.11 + image: golang:1.15 commands: - - "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/linux/arm64/drone-docker ./cmd/drone-docker" + - go version + - go env environment: CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - exclude: - - tag -- name: build-tag - pull: always - image: golang:1.11 +- name: build-docker + image: golang:1.15 commands: - - "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/linux/arm64/drone-docker ./cmd/drone-docker" + - go build -v -ldflags "-X main.version=" -a -tags netgo -o release/linux/arm64/drone-npm ./cmd/drone-npm environment: CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - - tag -- name: executable - pull: always - image: golang:1.11 +- name: executable-docker + image: golang:1.15 commands: - ./release/linux/arm64/drone-docker --help -- name: dryrun +- name: docker-docker pull: always - image: plugins/docker:18 - settings: - daemon_off: false - 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 - pull: always - image: plugins/docker:18 + image: plugins/docker settings: auto_tag: true auto_tag_suffix: linux-arm64 - daemon_off: false dockerfile: docker/docker/Dockerfile.linux.arm64 password: from_secret: docker_password repo: plugins/docker username: from_secret: docker_username - when: - event: - exclude: - - pull_request + +- name: build-acr + image: golang:1.15 + commands: + - go build -v -ldflags "-X main.version=" -a -tags netgo -o release/linux/arm64/drone-npm ./cmd/drone-npm + environment: + CGO_ENABLED: 0 + +- name: executable-acr + image: golang:1.15 + commands: + - ./release/linux/arm64/drone-acr --help + +- name: docker-acr + pull: always + image: plugins/docker + settings: + auto_tag: true + auto_tag_suffix: linux-arm64 + dockerfile: docker/acr/Dockerfile.linux.arm64 + password: + from_secret: docker_password + repo: plugins/acr + username: + from_secret: docker_username + +- name: build-ecr + image: golang:1.15 + commands: + - go build -v -ldflags "-X main.version=" -a -tags netgo -o release/linux/arm64/drone-npm ./cmd/drone-npm + environment: + CGO_ENABLED: 0 + +- name: executable-ecr + image: golang:1.15 + commands: + - ./release/linux/arm64/drone-ecr --help + +- name: docker-ecr + pull: always + image: plugins/docker + 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 + +- name: build-gcr + image: golang:1.15 + commands: + - go build -v -ldflags "-X main.version=" -a -tags netgo -o release/linux/arm64/drone-npm ./cmd/drone-npm + environment: + CGO_ENABLED: 0 + +- name: executable-gcr + image: golang:1.15 + commands: + - ./release/linux/arm64/drone-gcr --help + +- name: docker-gcr + pull: always + image: plugins/docker + 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 + +- name: build-heroku + image: golang:1.15 + commands: + - go build -v -ldflags "-X main.version=" -a -tags netgo -o release/linux/arm64/drone-npm ./cmd/drone-npm + environment: + CGO_ENABLED: 0 + +- name: executable-heroku + image: golang:1.15 + commands: + - ./release/linux/arm64/drone-heroku --help + +- name: docker-heroku + pull: always + image: plugins/docker + 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 trigger: ref: - refs/heads/master - - "refs/tags/**" - - "refs/pull/**" + - refs/tags/** + - refs/pull/** depends_on: - testing --- kind: pipeline -name: linux-arm-docker +type: docker +name: linux-arm platform: os: linux arch: arm steps: -- name: build-push +- name: environment pull: always - image: golang:1.11 + image: golang:1.15 commands: - - "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/linux/arm/drone-docker ./cmd/drone-docker" + - go version + - go env environment: CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - exclude: - - tag -- name: build-tag - pull: always - image: golang:1.11 +- name: build-docker + image: golang:1.15 commands: - - "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/linux/arm/drone-docker ./cmd/drone-docker" + - go build -v -ldflags "-X main.version=" -a -tags netgo -o release/linux/arm/drone-npm ./cmd/drone-npm environment: CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - - tag -- name: executable - pull: always - image: golang:1.11 +- name: executable-docker + image: golang:1.15 commands: - ./release/linux/arm/drone-docker --help -- name: dryrun +- name: docker-docker pull: always - image: plugins/docker:18 - settings: - daemon_off: false - 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:18 + image: plugins/docker settings: auto_tag: true auto_tag_suffix: linux-arm - daemon_off: false dockerfile: docker/docker/Dockerfile.linux.arm password: from_secret: docker_password repo: plugins/docker username: from_secret: docker_username - when: - event: - exclude: - - pull_request + +- name: build-acr + image: golang:1.15 + commands: + - go build -v -ldflags "-X main.version=" -a -tags netgo -o release/linux/arm/drone-npm ./cmd/drone-npm + environment: + CGO_ENABLED: 0 + +- name: executable-acr + image: golang:1.15 + commands: + - ./release/linux/arm/drone-acr --help + +- name: docker-acr + pull: always + image: plugins/docker + settings: + auto_tag: true + auto_tag_suffix: linux-arm + dockerfile: docker/acr/Dockerfile.linux.arm + password: + from_secret: docker_password + repo: plugins/acr + username: + from_secret: docker_username + +- name: build-ecr + image: golang:1.15 + commands: + - go build -v -ldflags "-X main.version=" -a -tags netgo -o release/linux/arm/drone-npm ./cmd/drone-npm + environment: + CGO_ENABLED: 0 + +- name: executable-ecr + image: golang:1.15 + commands: + - ./release/linux/arm/drone-ecr --help + +- name: docker-ecr + pull: always + image: plugins/docker + 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 + +- name: build-gcr + image: golang:1.15 + commands: + - go build -v -ldflags "-X main.version=" -a -tags netgo -o release/linux/arm/drone-npm ./cmd/drone-npm + environment: + CGO_ENABLED: 0 + +- name: executable-gcr + image: golang:1.15 + commands: + - ./release/linux/arm/drone-gcr --help + +- name: docker-gcr + pull: always + image: plugins/docker + 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 + +- name: build-heroku + image: golang:1.15 + commands: + - go build -v -ldflags "-X main.version=" -a -tags netgo -o release/linux/arm/drone-npm ./cmd/drone-npm + environment: + CGO_ENABLED: 0 + +- name: executable-heroku + image: golang:1.15 + commands: + - ./release/linux/arm/drone-heroku --help + +- name: docker-heroku + pull: always + image: plugins/docker + 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 trigger: ref: - refs/heads/master - - "refs/tags/**" - - "refs/pull/**" + - refs/tags/** + - refs/pull/** depends_on: - testing --- kind: pipeline -name: notifications-docker +type: docker +name: manifest platform: os: linux arch: amd64 steps: -- name: manifest +- name: manifest-docker pull: always image: plugins/manifest settings: @@ -426,271 +533,14 @@ steps: username: from_secret: docker_username -- name: microbadger +- name: microbadger-docker pull: always image: plugins/webhook - failure: ignore settings: urls: - from_secret: microbadger_docker + from_secret: microbadger_url -trigger: - ref: - - refs/heads/master - - "refs/tags/**" - -depends_on: -- windows-1809-amd64-docker -- windows-1903-amd64-docker -- windows-1909-amd64-docker -- linux-amd64-docker -- linux-arm64-docker -- linux-arm-docker - ---- -kind: pipeline -name: linux-amd64-gcr - -platform: - os: linux - arch: amd64 - -steps: -- name: build-push - pull: always - image: golang:1.11 - commands: - - "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/linux/amd64/drone-gcr ./cmd/drone-gcr" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - exclude: - - tag - -- name: build-tag - pull: always - image: golang:1.11 - commands: - - "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/linux/amd64/drone-gcr ./cmd/drone-gcr" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - - tag - -- name: dryrun - pull: always - image: plugins/docker:18 - settings: - daemon_off: false - 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:18 - settings: - auto_tag: true - auto_tag_suffix: linux-amd64 - daemon_off: false - dockerfile: docker/gcr/Dockerfile.linux.amd64 - password: - from_secret: docker_password - repo: plugins/gcr - username: - from_secret: docker_username - when: - event: - exclude: - - pull_request - -trigger: - ref: - - refs/heads/master - - "refs/tags/**" - - "refs/pull/**" - -depends_on: -- linux-amd64-docker - ---- -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.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/linux/arm64/drone-gcr ./cmd/drone-gcr" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - exclude: - - tag - -- name: build-tag - pull: always - image: golang:1.11 - commands: - - "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/linux/arm64/drone-gcr ./cmd/drone-gcr" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - - tag - -- name: dryrun - pull: always - image: plugins/docker:18 - settings: - daemon_off: false - 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:18 - settings: - auto_tag: true - auto_tag_suffix: linux-arm64 - daemon_off: false - dockerfile: docker/gcr/Dockerfile.linux.arm64 - password: - from_secret: docker_password - repo: plugins/gcr - username: - from_secret: docker_username - when: - event: - exclude: - - pull_request - -trigger: - ref: - - refs/heads/master - - "refs/tags/**" - - "refs/pull/**" - -depends_on: -- 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.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/linux/arm/drone-gcr ./cmd/drone-gcr" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - exclude: - - tag - -- name: build-tag - pull: always - image: golang:1.11 - commands: - - "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/linux/arm/drone-gcr ./cmd/drone-gcr" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - - tag - -- name: dryrun - pull: always - image: plugins/docker:18 - settings: - daemon_off: false - 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:18 - settings: - auto_tag: true - auto_tag_suffix: linux-arm - daemon_off: false - dockerfile: docker/gcr/Dockerfile.linux.arm - password: - from_secret: docker_password - repo: plugins/gcr - username: - from_secret: docker_username - when: - event: - exclude: - - pull_request - -trigger: - ref: - - refs/heads/master - - "refs/tags/**" - - "refs/pull/**" - -depends_on: -- linux-arm-docker - ---- -kind: pipeline -name: notifications-gcr - -platform: - os: linux - arch: amd64 - -steps: -- name: manifest +- name: manifest-acr pull: always image: plugins/manifest settings: @@ -698,272 +548,18 @@ steps: ignore_missing: true password: from_secret: docker_password - spec: docker/gcr/manifest.tmpl + spec: docker/acr/manifest.tmpl username: from_secret: docker_username -- name: microbadger +- name: microbadger-acr pull: always image: plugins/webhook - failure: ignore settings: urls: - from_secret: microbadger_gcr + from_secret: microbadger_url -trigger: - ref: - - refs/heads/master - - "refs/tags/**" - -depends_on: -- linux-amd64-gcr -- linux-arm64-gcr -- linux-arm-gcr - ---- -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.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/linux/amd64/drone-ecr ./cmd/drone-ecr" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - exclude: - - tag - -- name: build-tag - pull: always - image: golang:1.11 - commands: - - "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/linux/amd64/drone-ecr ./cmd/drone-ecr" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - - tag - -- name: dryrun - pull: always - image: plugins/docker:18 - settings: - daemon_off: false - 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:18 - settings: - auto_tag: true - auto_tag_suffix: linux-amd64 - daemon_off: false - dockerfile: docker/ecr/Dockerfile.linux.amd64 - password: - from_secret: docker_password - repo: plugins/ecr - username: - from_secret: docker_username - when: - event: - exclude: - - pull_request - -trigger: - ref: - - refs/heads/master - - "refs/tags/**" - - "refs/pull/**" - -depends_on: -- linux-amd64-docker - ---- -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.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/linux/arm64/drone-ecr ./cmd/drone-ecr" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - exclude: - - tag - -- name: build-tag - pull: always - image: golang:1.11 - commands: - - "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/linux/arm64/drone-ecr ./cmd/drone-ecr" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - - tag - -- name: dryrun - pull: always - image: plugins/docker:18 - settings: - daemon_off: false - 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:18 - settings: - auto_tag: true - auto_tag_suffix: linux-arm64 - daemon_off: false - dockerfile: docker/ecr/Dockerfile.linux.arm64 - password: - from_secret: docker_password - repo: plugins/ecr - username: - from_secret: docker_username - when: - event: - exclude: - - pull_request - -trigger: - ref: - - refs/heads/master - - "refs/tags/**" - - "refs/pull/**" - -depends_on: -- 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.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/linux/arm/drone-ecr ./cmd/drone-ecr" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - exclude: - - tag - -- name: build-tag - pull: always - image: golang:1.11 - commands: - - "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/linux/arm/drone-ecr ./cmd/drone-ecr" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - - tag - -- name: dryrun - pull: always - image: plugins/docker:18 - settings: - daemon_off: false - 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:18 - settings: - auto_tag: true - auto_tag_suffix: linux-arm - daemon_off: false - dockerfile: docker/ecr/Dockerfile.linux.arm - password: - from_secret: docker_password - repo: plugins/ecr - username: - from_secret: docker_username - when: - event: - exclude: - - pull_request - -trigger: - ref: - - refs/heads/master - - "refs/tags/**" - - "refs/pull/**" - -depends_on: -- linux-arm-docker - ---- -kind: pipeline -name: notifications-ecr - -platform: - os: linux - arch: amd64 - -steps: -- name: manifest +- name: manifest-ecr pull: always image: plugins/manifest settings: @@ -975,268 +571,33 @@ steps: username: from_secret: docker_username -- name: microbadger +- name: microbadger-ecr pull: always image: plugins/webhook - failure: ignore settings: urls: - from_secret: microbadger_ecr + from_secret: microbadger_url -trigger: - ref: - - refs/heads/master - - "refs/tags/**" - -depends_on: -- linux-amd64-ecr -- linux-arm64-ecr -- linux-arm-ecr - ---- -kind: pipeline -name: linux-amd64-heroku - -platform: - os: linux - arch: amd64 - -steps: -- name: build-push +- name: manifest-gcr pull: always - image: golang:1.11 - commands: - - "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/linux/amd64/drone-heroku ./cmd/drone-heroku" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - exclude: - - tag - -- name: build-tag - pull: always - image: golang:1.11 - commands: - - "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/linux/amd64/drone-heroku ./cmd/drone-heroku" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - - tag - -- name: dryrun - pull: always - image: plugins/docker:18 - settings: - daemon_off: false - 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:18 + image: plugins/manifest settings: auto_tag: true - auto_tag_suffix: linux-amd64 - daemon_off: false - dockerfile: docker/heroku/Dockerfile.linux.amd64 + ignore_missing: true password: from_secret: docker_password - repo: plugins/heroku + spec: docker/gcr/manifest.tmpl username: from_secret: docker_username - when: - event: - exclude: - - pull_request -trigger: - ref: - - refs/heads/master - - "refs/tags/**" - - "refs/pull/**" - -depends_on: -- linux-amd64-docker - ---- -kind: pipeline -name: linux-arm64-heroku - -platform: - os: linux - arch: arm64 - -steps: -- name: build-push +- name: microbadger-gcr pull: always - image: golang:1.11 - commands: - - "go build -v -ldflags \"-X main.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/linux/arm64/drone-heroku ./cmd/drone-heroku" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - exclude: - - tag - -- name: build-tag - pull: always - image: golang:1.11 - commands: - - "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/linux/arm64/drone-heroku ./cmd/drone-heroku" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - - tag - -- name: dryrun - pull: always - image: plugins/docker:18 + image: plugins/webhook settings: - daemon_off: false - 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 + urls: + from_secret: microbadger_url -- name: publish - pull: always - image: plugins/docker:18 - settings: - auto_tag: true - auto_tag_suffix: linux-arm64 - daemon_off: false - dockerfile: docker/heroku/Dockerfile.linux.arm64 - password: - from_secret: docker_password - repo: plugins/heroku - username: - from_secret: docker_username - when: - event: - exclude: - - pull_request - -trigger: - ref: - - refs/heads/master - - "refs/tags/**" - - "refs/pull/**" - -depends_on: -- 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.version=${DRONE_COMMIT_SHA:0:8}\" -a -tags netgo -o release/linux/arm/drone-heroku ./cmd/drone-heroku" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - exclude: - - tag - -- name: build-tag - pull: always - image: golang:1.11 - commands: - - "go build -v -ldflags \"-X main.version=${DRONE_TAG##v}\" -a -tags netgo -o release/linux/arm/drone-heroku ./cmd/drone-heroku" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - - tag - -- name: dryrun - pull: always - image: plugins/docker:18 - settings: - daemon_off: false - 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:18 - settings: - auto_tag: true - auto_tag_suffix: linux-arm - daemon_off: false - dockerfile: docker/heroku/Dockerfile.linux.arm - password: - from_secret: docker_password - repo: plugins/heroku - username: - from_secret: docker_username - when: - event: - exclude: - - pull_request - -trigger: - ref: - - refs/heads/master - - "refs/tags/**" - - "refs/pull/**" - -depends_on: -- linux-arm-docker - ---- -kind: pipeline -name: notifications-heroku - -platform: - os: linux - arch: amd64 - -steps: -- name: manifest +- name: manifest-heroku pull: always image: plugins/manifest settings: @@ -1248,295 +609,54 @@ steps: username: from_secret: docker_username -- name: microbadger +- name: microbadger-heroku pull: always image: plugins/webhook - failure: ignore settings: urls: - from_secret: microbadger_heroku + from_secret: microbadger_url trigger: ref: - refs/heads/master - - "refs/tags/**" + - refs/tags/** depends_on: -- linux-amd64-heroku -- linux-arm64-heroku -- linux-arm-heroku +- linux-amd64 +- linux-arm64 +- linux-arm --- kind: pipeline -name: linux-amd64-acr +type: docker +name: gitter platform: os: linux arch: amd64 +clone: + disable: true + steps: -- name: build-push +- name: gitter 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-acr ./cmd/drone-acr" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - exclude: - - tag - -- 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-acr ./cmd/drone-acr" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - - tag - -- name: dryrun - pull: always - image: plugins/docker:18 + image: plugins/gitter settings: - daemon_off: false - dockerfile: docker/acr/Dockerfile.linux.amd64 - dry_run: true - password: - from_secret: docker_password - repo: plugins/acr - tags: linux-amd64 - username: - from_secret: docker_username - when: - event: - - pull_request - -- name: publish - pull: always - image: plugins/docker:18 - settings: - auto_tag: true - auto_tag_suffix: linux-amd64 - daemon_off: false - dockerfile: docker/acr/Dockerfile.linux.amd64 - password: - from_secret: docker_password - repo: plugins/acr - username: - from_secret: docker_username - when: - event: - exclude: - - pull_request + webhook: + from_secret: gitter_webhook trigger: ref: - refs/heads/master - - "refs/tags/**" - - "refs/pull/**" + - refs/tags/** + status: + - failure depends_on: -- linux-amd64-docker - ---- -kind: pipeline -name: linux-arm64-acr - -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-acr ./cmd/drone-acr" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - exclude: - - tag - -- 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-acr ./cmd/drone-acr" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - - tag - -- name: dryrun - pull: always - image: plugins/docker:18 - settings: - daemon_off: false - dockerfile: docker/acr/Dockerfile.linux.arm64 - dry_run: true - password: - from_secret: docker_password - repo: plugins/acr - tags: linux-arm64 - username: - from_secret: docker_username - when: - event: - - pull_request - -- name: publish - pull: always - image: plugins/docker:18 - settings: - auto_tag: true - auto_tag_suffix: linux-arm64 - daemon_off: false - dockerfile: docker/acr/Dockerfile.linux.arm64 - password: - from_secret: docker_password - repo: plugins/acr - username: - from_secret: docker_username - when: - event: - exclude: - - pull_request - -trigger: - ref: - - refs/heads/master - - "refs/tags/**" - - "refs/pull/**" - -depends_on: -- linux-arm64-docker - ---- -kind: pipeline -name: linux-arm-acr - -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-acr ./cmd/drone-acr" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - exclude: - - tag - -- 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-acr ./cmd/drone-acr" - environment: - CGO_ENABLED: 0 - GO111MODULE: on - when: - event: - - tag - -- name: dryrun - pull: always - image: plugins/docker:18 - settings: - daemon_off: false - dockerfile: docker/acr/Dockerfile.linux.arm - dry_run: true - password: - from_secret: docker_password - repo: plugins/acr - tags: linux-arm - username: - from_secret: docker_username - when: - event: - - pull_request - -- name: publish - pull: always - image: plugins/docker:18 - settings: - auto_tag: true - auto_tag_suffix: linux-arm - daemon_off: false - dockerfile: docker/acr/Dockerfile.linux.arm - password: - from_secret: docker_password - repo: plugins/acr - username: - from_secret: docker_username - when: - event: - exclude: - - pull_request - -trigger: - ref: - - refs/heads/master - - "refs/tags/**" - - "refs/pull/**" - -depends_on: -- linux-arm-docker - ---- -kind: pipeline -name: notifications-acr - -platform: - os: linux - arch: amd64 - -steps: -- name: manifest - pull: always - image: plugins/manifest - settings: - ignore_missing: true - password: - from_secret: docker_password - spec: docker/acr/manifest.tmpl - username: - from_secret: docker_username - -- name: microbadger - pull: always - image: plugins/webhook - failure: ignore - settings: - url: - from_secret: microbadger_acr - -trigger: - ref: - - refs/heads/master - - "refs/tags/**" - -depends_on: -- linux-amd64-acr -- linux-arm64-acr -- linux-arm-acr - +- manifest +- linux-amd64 +- linux-arm64 +- linux-arm ...