Fix duplicated step names

This commit is contained in:
Thomas Boerger 2019-01-21 01:05:01 +01:00
parent 7bea9aab6c
commit e6289388c4
No known key found for this signature in database
GPG Key ID: 09745AFF9D63C79B
3 changed files with 984 additions and 960 deletions

View File

@ -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"),
]

View File

@ -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

1401
.drone.yml

File diff suppressed because it is too large Load Diff