mirror of
https://github.com/drone-plugins/drone-docker.git
synced 2026-06-15 06:21:51 +08:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 55522cce76 | |||
| ab3fed4710 | |||
| e62984fe46 | |||
| c48ca605a4 | |||
| 0e03ef3eab | |||
| 7a498e78b2 | |||
| 2140a2be40 | |||
| dcc762d301 | |||
| b318c15acb | |||
| 86de147dc8 | |||
| 68605049b7 | |||
| e2e30f3015 |
+27
-27
@@ -162,7 +162,7 @@ platform:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: go build
|
- name: go build
|
||||||
image: golang:1.22.4
|
image: golang:1.22.7
|
||||||
environment:
|
environment:
|
||||||
CGO_ENABLED: 0
|
CGO_ENABLED: 0
|
||||||
commands:
|
commands:
|
||||||
@@ -264,7 +264,7 @@ platform:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: build-push
|
- name: build-push
|
||||||
image: golang:1.22.4
|
image: golang:1.22.7
|
||||||
commands:
|
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 build -v -ldflags "-X main.version=${DRONE_COMMIT_SHA:0:8}" -a -tags netgo -o release/linux/amd64/drone-docker ./cmd/drone-docker'
|
||||||
environment:
|
environment:
|
||||||
@@ -275,7 +275,7 @@ steps:
|
|||||||
- tag
|
- tag
|
||||||
|
|
||||||
- name: build-tag
|
- name: build-tag
|
||||||
image: golang:1.22.4
|
image: golang:1.22.7
|
||||||
commands:
|
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=${DRONE_TAG##v}" -a -tags netgo -o release/linux/amd64/drone-docker ./cmd/drone-docker'
|
||||||
environment:
|
environment:
|
||||||
@@ -285,7 +285,7 @@ steps:
|
|||||||
- tag
|
- tag
|
||||||
|
|
||||||
- name: executable
|
- name: executable
|
||||||
image: golang:1.22.4
|
image: golang:1.22.7
|
||||||
commands:
|
commands:
|
||||||
- ./release/linux/amd64/drone-docker --help
|
- ./release/linux/amd64/drone-docker --help
|
||||||
|
|
||||||
@@ -329,7 +329,7 @@ platform:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: build-push
|
- name: build-push
|
||||||
image: golang:1.22.4
|
image: golang:1.22.7
|
||||||
commands:
|
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 build -v -ldflags "-X main.version=${DRONE_COMMIT_SHA:0:8}" -a -tags netgo -o release/linux/arm64/drone-docker ./cmd/drone-docker'
|
||||||
environment:
|
environment:
|
||||||
@@ -340,7 +340,7 @@ steps:
|
|||||||
- tag
|
- tag
|
||||||
|
|
||||||
- name: build-tag
|
- name: build-tag
|
||||||
image: golang:1.22.4
|
image: golang:1.22.7
|
||||||
commands:
|
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=${DRONE_TAG##v}" -a -tags netgo -o release/linux/arm64/drone-docker ./cmd/drone-docker'
|
||||||
environment:
|
environment:
|
||||||
@@ -350,7 +350,7 @@ steps:
|
|||||||
- tag
|
- tag
|
||||||
|
|
||||||
- name: executable
|
- name: executable
|
||||||
image: golang:1.22.4
|
image: golang:1.22.7
|
||||||
commands:
|
commands:
|
||||||
- ./release/linux/arm64/drone-docker --help
|
- ./release/linux/arm64/drone-docker --help
|
||||||
|
|
||||||
@@ -429,7 +429,7 @@ platform:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: build-push
|
- name: build-push
|
||||||
image: golang:1.22.4
|
image: golang:1.22.7
|
||||||
commands:
|
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'
|
- '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:
|
environment:
|
||||||
@@ -440,7 +440,7 @@ steps:
|
|||||||
- tag
|
- tag
|
||||||
|
|
||||||
- name: build-tag
|
- name: build-tag
|
||||||
image: golang:1.22.4
|
image: golang:1.22.7
|
||||||
commands:
|
commands:
|
||||||
- 'go build -v -ldflags "-X main.version=${DRONE_TAG##v}" -a -tags netgo -o release/linux/amd64/drone-gcr ./cmd/drone-gcr'
|
- 'go build -v -ldflags "-X main.version=${DRONE_TAG##v}" -a -tags netgo -o release/linux/amd64/drone-gcr ./cmd/drone-gcr'
|
||||||
environment:
|
environment:
|
||||||
@@ -488,7 +488,7 @@ platform:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: build-push
|
- name: build-push
|
||||||
image: golang:1.22.4
|
image: golang:1.22.7
|
||||||
commands:
|
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'
|
- '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:
|
environment:
|
||||||
@@ -499,7 +499,7 @@ steps:
|
|||||||
- tag
|
- tag
|
||||||
|
|
||||||
- name: build-tag
|
- name: build-tag
|
||||||
image: golang:1.22.4
|
image: golang:1.22.7
|
||||||
commands:
|
commands:
|
||||||
- 'go build -v -ldflags "-X main.version=${DRONE_TAG##v}" -a -tags netgo -o release/linux/arm64/drone-gcr ./cmd/drone-gcr'
|
- 'go build -v -ldflags "-X main.version=${DRONE_TAG##v}" -a -tags netgo -o release/linux/arm64/drone-gcr ./cmd/drone-gcr'
|
||||||
environment:
|
environment:
|
||||||
@@ -582,7 +582,7 @@ platform:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: build-push
|
- name: build-push
|
||||||
image: golang:1.22.4
|
image: golang:1.22.7
|
||||||
commands:
|
commands:
|
||||||
- 'go build -v -ldflags "-X main.version=${DRONE_COMMIT_SHA:0:8}" -a -tags netgo -o release/linux/amd64/drone-gar ./cmd/drone-gar'
|
- 'go build -v -ldflags "-X main.version=${DRONE_COMMIT_SHA:0:8}" -a -tags netgo -o release/linux/amd64/drone-gar ./cmd/drone-gar'
|
||||||
environment:
|
environment:
|
||||||
@@ -593,7 +593,7 @@ steps:
|
|||||||
- tag
|
- tag
|
||||||
|
|
||||||
- name: build-tag
|
- name: build-tag
|
||||||
image: golang:1.22.4
|
image: golang:1.22.7
|
||||||
commands:
|
commands:
|
||||||
- 'go build -v -ldflags "-X main.version=${DRONE_TAG##v}" -a -tags netgo -o release/linux/amd64/drone-gar ./cmd/drone-gar'
|
- 'go build -v -ldflags "-X main.version=${DRONE_TAG##v}" -a -tags netgo -o release/linux/amd64/drone-gar ./cmd/drone-gar'
|
||||||
environment:
|
environment:
|
||||||
@@ -641,7 +641,7 @@ platform:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: build-push
|
- name: build-push
|
||||||
image: golang:1.22.4
|
image: golang:1.22.7
|
||||||
commands:
|
commands:
|
||||||
- 'go build -v -ldflags "-X main.version=${DRONE_COMMIT_SHA:0:8}" -a -tags netgo -o release/linux/arm64/drone-gar ./cmd/drone-gar'
|
- 'go build -v -ldflags "-X main.version=${DRONE_COMMIT_SHA:0:8}" -a -tags netgo -o release/linux/arm64/drone-gar ./cmd/drone-gar'
|
||||||
environment:
|
environment:
|
||||||
@@ -652,7 +652,7 @@ steps:
|
|||||||
- tag
|
- tag
|
||||||
|
|
||||||
- name: build-tag
|
- name: build-tag
|
||||||
image: golang:1.22.4
|
image: golang:1.22.7
|
||||||
commands:
|
commands:
|
||||||
- 'go build -v -ldflags "-X main.version=${DRONE_TAG##v}" -a -tags netgo -o release/linux/arm64/drone-gar ./cmd/drone-gar'
|
- 'go build -v -ldflags "-X main.version=${DRONE_TAG##v}" -a -tags netgo -o release/linux/arm64/drone-gar ./cmd/drone-gar'
|
||||||
environment:
|
environment:
|
||||||
@@ -734,7 +734,7 @@ platform:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: build-push
|
- name: build-push
|
||||||
image: golang:1.22.4
|
image: golang:1.22.7
|
||||||
commands:
|
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'
|
- '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:
|
environment:
|
||||||
@@ -744,7 +744,7 @@ steps:
|
|||||||
exclude:
|
exclude:
|
||||||
- tag
|
- tag
|
||||||
- name: build-tag
|
- name: build-tag
|
||||||
image: golang:1.22.4
|
image: golang:1.22.7
|
||||||
commands:
|
commands:
|
||||||
- 'go build -v -ldflags "-X main.version=${DRONE_TAG##v}" -a -tags netgo -o release/linux/amd64/drone-ecr ./cmd/drone-ecr'
|
- 'go build -v -ldflags "-X main.version=${DRONE_TAG##v}" -a -tags netgo -o release/linux/amd64/drone-ecr ./cmd/drone-ecr'
|
||||||
environment:
|
environment:
|
||||||
@@ -792,7 +792,7 @@ platform:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: build-push
|
- name: build-push
|
||||||
image: golang:1.22.4
|
image: golang:1.22.7
|
||||||
commands:
|
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'
|
- '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:
|
environment:
|
||||||
@@ -802,7 +802,7 @@ steps:
|
|||||||
exclude:
|
exclude:
|
||||||
- tag
|
- tag
|
||||||
- name: build-tag
|
- name: build-tag
|
||||||
image: golang:1.22.4
|
image: golang:1.22.7
|
||||||
commands:
|
commands:
|
||||||
- 'go build -v -ldflags "-X main.version=${DRONE_TAG##v}" -a -tags netgo -o release/linux/arm64/drone-ecr ./cmd/drone-ecr'
|
- 'go build -v -ldflags "-X main.version=${DRONE_TAG##v}" -a -tags netgo -o release/linux/arm64/drone-ecr ./cmd/drone-ecr'
|
||||||
environment:
|
environment:
|
||||||
@@ -885,7 +885,7 @@ platform:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: build-push
|
- name: build-push
|
||||||
image: golang:1.22.4
|
image: golang:1.22.7
|
||||||
commands:
|
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'
|
- '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:
|
environment:
|
||||||
@@ -895,7 +895,7 @@ steps:
|
|||||||
exclude:
|
exclude:
|
||||||
- tag
|
- tag
|
||||||
- name: build-tag
|
- name: build-tag
|
||||||
image: golang:1.22.4
|
image: golang:1.22.7
|
||||||
commands:
|
commands:
|
||||||
- 'go build -v -ldflags "-X main.version=${DRONE_TAG##v}" -a -tags netgo -o release/linux/amd64/drone-heroku ./cmd/drone-heroku'
|
- 'go build -v -ldflags "-X main.version=${DRONE_TAG##v}" -a -tags netgo -o release/linux/amd64/drone-heroku ./cmd/drone-heroku'
|
||||||
environment:
|
environment:
|
||||||
@@ -944,7 +944,7 @@ platform:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: build-push
|
- name: build-push
|
||||||
image: golang:1.22.4
|
image: golang:1.22.7
|
||||||
commands:
|
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'
|
- '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:
|
environment:
|
||||||
@@ -954,7 +954,7 @@ steps:
|
|||||||
exclude:
|
exclude:
|
||||||
- tag
|
- tag
|
||||||
- name: build-tag
|
- name: build-tag
|
||||||
image: golang:1.22.4
|
image: golang:1.22.7
|
||||||
commands:
|
commands:
|
||||||
- 'go build -v -ldflags "-X main.version=${DRONE_TAG##v}" -a -tags netgo -o release/linux/arm64/drone-heroku ./cmd/drone-heroku'
|
- 'go build -v -ldflags "-X main.version=${DRONE_TAG##v}" -a -tags netgo -o release/linux/arm64/drone-heroku ./cmd/drone-heroku'
|
||||||
environment:
|
environment:
|
||||||
@@ -1035,7 +1035,7 @@ platform:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: build-push
|
- name: build-push
|
||||||
image: golang:1.22.4
|
image: golang:1.22.7
|
||||||
commands:
|
commands:
|
||||||
- 'go build -v -ldflags "-X main.build=${DRONE_BUILD_NUMBER}" -a -tags netgo -o release/linux/amd64/drone-acr ./cmd/drone-acr'
|
- 'go build -v -ldflags "-X main.build=${DRONE_BUILD_NUMBER}" -a -tags netgo -o release/linux/amd64/drone-acr ./cmd/drone-acr'
|
||||||
environment:
|
environment:
|
||||||
@@ -1045,7 +1045,7 @@ steps:
|
|||||||
exclude:
|
exclude:
|
||||||
- tag
|
- tag
|
||||||
- name: build-tag
|
- name: build-tag
|
||||||
image: golang:1.22.4
|
image: golang:1.22.7
|
||||||
commands:
|
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'
|
- '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:
|
environment:
|
||||||
@@ -1093,7 +1093,7 @@ platform:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: build-push
|
- name: build-push
|
||||||
image: golang:1.22.4
|
image: golang:1.22.7
|
||||||
commands:
|
commands:
|
||||||
- 'go build -v -ldflags "-X main.build=${DRONE_BUILD_NUMBER}" -a -tags netgo -o release/linux/arm64/drone-acr ./cmd/drone-acr'
|
- 'go build -v -ldflags "-X main.build=${DRONE_BUILD_NUMBER}" -a -tags netgo -o release/linux/arm64/drone-acr ./cmd/drone-acr'
|
||||||
environment:
|
environment:
|
||||||
@@ -1104,7 +1104,7 @@ steps:
|
|||||||
- tag
|
- tag
|
||||||
|
|
||||||
- name: build-tag
|
- name: build-tag
|
||||||
image: golang:1.22.4
|
image: golang:1.22.7
|
||||||
commands:
|
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'
|
- '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:
|
environment:
|
||||||
|
|||||||
@@ -0,0 +1,125 @@
|
|||||||
|
inputSet:
|
||||||
|
name: event-PR
|
||||||
|
identifier: eventPR
|
||||||
|
orgIdentifier: default
|
||||||
|
projectIdentifier: Drone_Plugins
|
||||||
|
pipeline:
|
||||||
|
identifier: dronedockerharness
|
||||||
|
properties:
|
||||||
|
ci:
|
||||||
|
codebase:
|
||||||
|
build:
|
||||||
|
type: PR
|
||||||
|
spec:
|
||||||
|
number: <+trigger.prNumber>
|
||||||
|
stages:
|
||||||
|
- stage:
|
||||||
|
identifier: linamd64
|
||||||
|
type: CI
|
||||||
|
spec:
|
||||||
|
execution:
|
||||||
|
steps:
|
||||||
|
- step:
|
||||||
|
identifier: Build_Push
|
||||||
|
type: Run
|
||||||
|
spec:
|
||||||
|
command: go build -a -tags netgo -o release/linux/amd64/drone-<+matrix.repo> ./cmd/drone-<+matrix.repo>
|
||||||
|
- step:
|
||||||
|
identifier: Docker_Build_and_Push
|
||||||
|
type: Plugin
|
||||||
|
spec:
|
||||||
|
settings:
|
||||||
|
repo: plugins/<+matrix.repo>
|
||||||
|
dockerfile: docker/<+matrix.repo>/Dockerfile.linux.amd64
|
||||||
|
auto_tag_suffix: linux-amd64
|
||||||
|
- step:
|
||||||
|
identifier: BuildAndPushDockerRegistry_1
|
||||||
|
type: BuildAndPushDockerRegistry
|
||||||
|
spec:
|
||||||
|
repo: plugins/<+matrix.repo>
|
||||||
|
tags:
|
||||||
|
- linux-amd64
|
||||||
|
dockerfile: docker/<+matrix.repo>/Dockerfile.linux.amd64
|
||||||
|
- stage:
|
||||||
|
identifier: linarm64
|
||||||
|
type: CI
|
||||||
|
spec:
|
||||||
|
execution:
|
||||||
|
steps:
|
||||||
|
- step:
|
||||||
|
identifier: buildpush
|
||||||
|
type: Run
|
||||||
|
spec:
|
||||||
|
command: go build -a -tags netgo -o release/linux/arm64/drone-<+matrix.repo> ./cmd/drone-<+matrix.repo>
|
||||||
|
- step:
|
||||||
|
identifier: Docker_Build_and_Push
|
||||||
|
type: Plugin
|
||||||
|
spec:
|
||||||
|
settings:
|
||||||
|
repo: plugins/<+matrix.repo>
|
||||||
|
dockerfile: docker/<+matrix.repo>/Dockerfile.linux.arm64
|
||||||
|
auto_tag_suffix: linux-arm64
|
||||||
|
- step:
|
||||||
|
identifier: BuildAndPushDockerRegistry_1
|
||||||
|
type: BuildAndPushDockerRegistry
|
||||||
|
spec:
|
||||||
|
repo: plugins/<+matrix.repo>
|
||||||
|
tags:
|
||||||
|
- linux-arm64
|
||||||
|
dockerfile: docker/<+matrix.repo>/Dockerfile.linux.arm64
|
||||||
|
- stage:
|
||||||
|
identifier: win1809amd64
|
||||||
|
type: CI
|
||||||
|
spec:
|
||||||
|
execution:
|
||||||
|
steps:
|
||||||
|
- step:
|
||||||
|
identifier: Docker_Build_and_Push1
|
||||||
|
type: Plugin
|
||||||
|
spec:
|
||||||
|
settings:
|
||||||
|
repo: plugins/<+matrix.repo>
|
||||||
|
dockerfile: docker/<+matrix.repo>/Dockerfile.windows.amd64.1809
|
||||||
|
auto_tag_suffix: windows-1809-amd64
|
||||||
|
- step:
|
||||||
|
identifier: BuildAndPushDockerRegistry_2
|
||||||
|
type: BuildAndPushDockerRegistry
|
||||||
|
spec:
|
||||||
|
repo: plugins/<+matrix.repo>
|
||||||
|
tags:
|
||||||
|
- windows-1809-amd64
|
||||||
|
dockerfile: docker/<+matrix.repo>/Dockerfile.windows.amd64.1809
|
||||||
|
- stage:
|
||||||
|
identifier: winamd64
|
||||||
|
type: CI
|
||||||
|
spec:
|
||||||
|
execution:
|
||||||
|
steps:
|
||||||
|
- step:
|
||||||
|
identifier: Docker_Build_and_Push1
|
||||||
|
type: Plugin
|
||||||
|
spec:
|
||||||
|
settings:
|
||||||
|
repo: plugins/<+matrix.repo>
|
||||||
|
dockerfile: docker/<+matrix.repo>/Dockerfile.windows.amd64.ltsc2022
|
||||||
|
auto_tag_suffix: windows-ltsc2022-amd64
|
||||||
|
- step:
|
||||||
|
identifier: BuildAndPushDockerRegistry_2
|
||||||
|
type: BuildAndPushDockerRegistry
|
||||||
|
spec:
|
||||||
|
repo: plugins/<+matrix.repo>
|
||||||
|
tags:
|
||||||
|
- windows-ltsc2022-amd64
|
||||||
|
dockerfile: docker/<+matrix.repo>/Dockerfile.windows.amd64.ltsc2022
|
||||||
|
- stage:
|
||||||
|
identifier: Manifest
|
||||||
|
type: CI
|
||||||
|
spec:
|
||||||
|
execution:
|
||||||
|
steps:
|
||||||
|
- step:
|
||||||
|
identifier: Plugin_1
|
||||||
|
type: Plugin
|
||||||
|
spec:
|
||||||
|
settings:
|
||||||
|
spec: docker/<+matrix.repo>/manifest.tmpl
|
||||||
@@ -0,0 +1,125 @@
|
|||||||
|
inputSet:
|
||||||
|
name: event-Push
|
||||||
|
identifier: eventPush
|
||||||
|
orgIdentifier: default
|
||||||
|
projectIdentifier: Drone_Plugins
|
||||||
|
pipeline:
|
||||||
|
identifier: dronedockerharness
|
||||||
|
properties:
|
||||||
|
ci:
|
||||||
|
codebase:
|
||||||
|
build:
|
||||||
|
type: branch
|
||||||
|
spec:
|
||||||
|
branch: <+trigger.branch>
|
||||||
|
stages:
|
||||||
|
- stage:
|
||||||
|
identifier: linamd64
|
||||||
|
type: CI
|
||||||
|
spec:
|
||||||
|
execution:
|
||||||
|
steps:
|
||||||
|
- step:
|
||||||
|
identifier: Build_Push
|
||||||
|
type: Run
|
||||||
|
spec:
|
||||||
|
command: go build -a -tags netgo -o release/linux/amd64/drone-<+matrix.repo> ./cmd/drone-<+matrix.repo>
|
||||||
|
- step:
|
||||||
|
identifier: Docker_Build_and_Push
|
||||||
|
type: Plugin
|
||||||
|
spec:
|
||||||
|
settings:
|
||||||
|
repo: plugins/<+matrix.repo>
|
||||||
|
dockerfile: docker/<+matrix.repo>/Dockerfile.linux.amd64
|
||||||
|
auto_tag_suffix: linux-amd64
|
||||||
|
- step:
|
||||||
|
identifier: BuildAndPushDockerRegistry_1
|
||||||
|
type: BuildAndPushDockerRegistry
|
||||||
|
spec:
|
||||||
|
repo: plugins/<+matrix.repo>
|
||||||
|
tags:
|
||||||
|
- linux-amd64
|
||||||
|
dockerfile: docker/<+matrix.repo>/Dockerfile.linux.amd64
|
||||||
|
- stage:
|
||||||
|
identifier: linarm64
|
||||||
|
type: CI
|
||||||
|
spec:
|
||||||
|
execution:
|
||||||
|
steps:
|
||||||
|
- step:
|
||||||
|
identifier: buildpush
|
||||||
|
type: Run
|
||||||
|
spec:
|
||||||
|
command: go build -a -tags netgo -o release/linux/arm64/drone-<+matrix.repo> ./cmd/drone-<+matrix.repo>
|
||||||
|
- step:
|
||||||
|
identifier: Docker_Build_and_Push
|
||||||
|
type: Plugin
|
||||||
|
spec:
|
||||||
|
settings:
|
||||||
|
repo: plugins/<+matrix.repo>
|
||||||
|
dockerfile: docker/<+matrix.repo>/Dockerfile.linux.arm64
|
||||||
|
auto_tag_suffix: linux-arm64
|
||||||
|
- step:
|
||||||
|
identifier: BuildAndPushDockerRegistry_1
|
||||||
|
type: BuildAndPushDockerRegistry
|
||||||
|
spec:
|
||||||
|
repo: plugins/<+matrix.repo>
|
||||||
|
tags:
|
||||||
|
- linux-arm64
|
||||||
|
dockerfile: docker/<+matrix.repo>/Dockerfile.linux.arm64
|
||||||
|
- stage:
|
||||||
|
identifier: win1809amd64
|
||||||
|
type: CI
|
||||||
|
spec:
|
||||||
|
execution:
|
||||||
|
steps:
|
||||||
|
- step:
|
||||||
|
identifier: Docker_Build_and_Push1
|
||||||
|
type: Plugin
|
||||||
|
spec:
|
||||||
|
settings:
|
||||||
|
repo: plugins/<+matrix.repo>
|
||||||
|
dockerfile: docker/<+matrix.repo>/Dockerfile.windows.amd64.1809
|
||||||
|
auto_tag_suffix: windows-1809-amd64
|
||||||
|
- step:
|
||||||
|
identifier: BuildAndPushDockerRegistry_2
|
||||||
|
type: BuildAndPushDockerRegistry
|
||||||
|
spec:
|
||||||
|
repo: plugins/<+matrix.repo>
|
||||||
|
tags:
|
||||||
|
- windows-1809-amd64
|
||||||
|
dockerfile: docker/<+matrix.repo>/Dockerfile.windows.amd64.1809
|
||||||
|
- stage:
|
||||||
|
identifier: winamd64
|
||||||
|
type: CI
|
||||||
|
spec:
|
||||||
|
execution:
|
||||||
|
steps:
|
||||||
|
- step:
|
||||||
|
identifier: Docker_Build_and_Push1
|
||||||
|
type: Plugin
|
||||||
|
spec:
|
||||||
|
settings:
|
||||||
|
repo: plugins/<+matrix.repo>
|
||||||
|
dockerfile: docker/<+matrix.repo>/Dockerfile.windows.amd64.ltsc2022
|
||||||
|
auto_tag_suffix: windows-ltsc2022-amd64
|
||||||
|
- step:
|
||||||
|
identifier: BuildAndPushDockerRegistry_2
|
||||||
|
type: BuildAndPushDockerRegistry
|
||||||
|
spec:
|
||||||
|
repo: plugins/<+matrix.repo>
|
||||||
|
tags:
|
||||||
|
- windows-ltsc2022-amd64
|
||||||
|
dockerfile: docker/<+matrix.repo>/Dockerfile.windows.amd64.ltsc2022
|
||||||
|
- stage:
|
||||||
|
identifier: Manifest
|
||||||
|
type: CI
|
||||||
|
spec:
|
||||||
|
execution:
|
||||||
|
steps:
|
||||||
|
- step:
|
||||||
|
identifier: Plugin_1
|
||||||
|
type: Plugin
|
||||||
|
spec:
|
||||||
|
settings:
|
||||||
|
spec: docker/<+matrix.repo>/manifest.tmpl
|
||||||
@@ -0,0 +1,125 @@
|
|||||||
|
inputSet:
|
||||||
|
name: event-Tag
|
||||||
|
identifier: eventTag
|
||||||
|
orgIdentifier: default
|
||||||
|
projectIdentifier: Drone_Plugins
|
||||||
|
pipeline:
|
||||||
|
identifier: dronedockerharness
|
||||||
|
properties:
|
||||||
|
ci:
|
||||||
|
codebase:
|
||||||
|
build:
|
||||||
|
type: tag
|
||||||
|
spec:
|
||||||
|
tag: <+trigger.tag>
|
||||||
|
stages:
|
||||||
|
- stage:
|
||||||
|
identifier: linamd64
|
||||||
|
type: CI
|
||||||
|
spec:
|
||||||
|
execution:
|
||||||
|
steps:
|
||||||
|
- step:
|
||||||
|
identifier: Build_Push
|
||||||
|
type: Run
|
||||||
|
spec:
|
||||||
|
command: go build -a -tags netgo -o release/linux/amd64/drone-<+matrix.repo> ./cmd/drone-<+matrix.repo>
|
||||||
|
- step:
|
||||||
|
identifier: Docker_Build_and_Push
|
||||||
|
type: Plugin
|
||||||
|
spec:
|
||||||
|
settings:
|
||||||
|
repo: plugins/<+matrix.repo>
|
||||||
|
dockerfile: docker/<+matrix.repo>/Dockerfile.linux.amd64
|
||||||
|
auto_tag_suffix: linux-amd64
|
||||||
|
- step:
|
||||||
|
identifier: BuildAndPushDockerRegistry_1
|
||||||
|
type: BuildAndPushDockerRegistry
|
||||||
|
spec:
|
||||||
|
repo: plugins/<+matrix.repo>
|
||||||
|
tags:
|
||||||
|
- linux-amd64
|
||||||
|
dockerfile: docker/<+matrix.repo>/Dockerfile.linux.amd64
|
||||||
|
- stage:
|
||||||
|
identifier: linarm64
|
||||||
|
type: CI
|
||||||
|
spec:
|
||||||
|
execution:
|
||||||
|
steps:
|
||||||
|
- step:
|
||||||
|
identifier: buildpush
|
||||||
|
type: Run
|
||||||
|
spec:
|
||||||
|
command: go build -a -tags netgo -o release/linux/arm64/drone-<+matrix.repo> ./cmd/drone-<+matrix.repo>
|
||||||
|
- step:
|
||||||
|
identifier: Docker_Build_and_Push
|
||||||
|
type: Plugin
|
||||||
|
spec:
|
||||||
|
settings:
|
||||||
|
repo: plugins/<+matrix.repo>
|
||||||
|
dockerfile: docker/<+matrix.repo>/Dockerfile.linux.arm64
|
||||||
|
auto_tag_suffix: linux-arm64
|
||||||
|
- step:
|
||||||
|
identifier: BuildAndPushDockerRegistry_1
|
||||||
|
type: BuildAndPushDockerRegistry
|
||||||
|
spec:
|
||||||
|
repo: plugins/<+matrix.repo>
|
||||||
|
tags:
|
||||||
|
- linux-arm64
|
||||||
|
dockerfile: docker/<+matrix.repo>/Dockerfile.linux.arm64
|
||||||
|
- stage:
|
||||||
|
identifier: win1809amd64
|
||||||
|
type: CI
|
||||||
|
spec:
|
||||||
|
execution:
|
||||||
|
steps:
|
||||||
|
- step:
|
||||||
|
identifier: Docker_Build_and_Push1
|
||||||
|
type: Plugin
|
||||||
|
spec:
|
||||||
|
settings:
|
||||||
|
repo: plugins/<+matrix.repo>
|
||||||
|
dockerfile: docker/<+matrix.repo>/Dockerfile.windows.amd64.1809
|
||||||
|
auto_tag_suffix: windows-1809-amd64
|
||||||
|
- step:
|
||||||
|
identifier: BuildAndPushDockerRegistry_2
|
||||||
|
type: BuildAndPushDockerRegistry
|
||||||
|
spec:
|
||||||
|
repo: plugins/<+matrix.repo>
|
||||||
|
tags:
|
||||||
|
- windows-1809-amd64
|
||||||
|
dockerfile: docker/<+matrix.repo>/Dockerfile.windows.amd64.1809
|
||||||
|
- stage:
|
||||||
|
identifier: winamd64
|
||||||
|
type: CI
|
||||||
|
spec:
|
||||||
|
execution:
|
||||||
|
steps:
|
||||||
|
- step:
|
||||||
|
identifier: Docker_Build_and_Push1
|
||||||
|
type: Plugin
|
||||||
|
spec:
|
||||||
|
settings:
|
||||||
|
repo: plugins/<+matrix.repo>
|
||||||
|
dockerfile: docker/<+matrix.repo>/Dockerfile.windows.amd64.ltsc2022
|
||||||
|
auto_tag_suffix: windows-ltsc2022-amd64
|
||||||
|
- step:
|
||||||
|
identifier: BuildAndPushDockerRegistry_2
|
||||||
|
type: BuildAndPushDockerRegistry
|
||||||
|
spec:
|
||||||
|
repo: plugins/<+matrix.repo>
|
||||||
|
tags:
|
||||||
|
- windows-ltsc2022-amd64
|
||||||
|
dockerfile: docker/<+matrix.repo>/Dockerfile.windows.amd64.ltsc2022
|
||||||
|
- stage:
|
||||||
|
identifier: Manifest
|
||||||
|
type: CI
|
||||||
|
spec:
|
||||||
|
execution:
|
||||||
|
steps:
|
||||||
|
- step:
|
||||||
|
identifier: Plugin_1
|
||||||
|
type: Plugin
|
||||||
|
spec:
|
||||||
|
settings:
|
||||||
|
spec: docker/<+matrix.repo>/manifest.tmpl
|
||||||
@@ -0,0 +1,382 @@
|
|||||||
|
pipeline:
|
||||||
|
orgIdentifier: default
|
||||||
|
tags: {}
|
||||||
|
properties:
|
||||||
|
ci:
|
||||||
|
codebase:
|
||||||
|
connectorRef: GitHub_Drone_Plugins_Org
|
||||||
|
repoName: drone-docker
|
||||||
|
build: <+input>
|
||||||
|
sparseCheckout: []
|
||||||
|
stages:
|
||||||
|
- stage:
|
||||||
|
name: Test
|
||||||
|
identifier: Test
|
||||||
|
description: ""
|
||||||
|
type: CI
|
||||||
|
spec:
|
||||||
|
cloneCodebase: true
|
||||||
|
caching:
|
||||||
|
enabled: false
|
||||||
|
paths: []
|
||||||
|
platform:
|
||||||
|
os: Linux
|
||||||
|
arch: Amd64
|
||||||
|
runtime:
|
||||||
|
type: Cloud
|
||||||
|
spec: {}
|
||||||
|
execution:
|
||||||
|
steps:
|
||||||
|
- step:
|
||||||
|
type: Run
|
||||||
|
name: GO VET
|
||||||
|
identifier: Run_1
|
||||||
|
spec:
|
||||||
|
connectorRef: account.harnessImage
|
||||||
|
image: golang:1.22.4
|
||||||
|
shell: Sh
|
||||||
|
command: go vet ./...
|
||||||
|
- step:
|
||||||
|
type: Run
|
||||||
|
name: GO TEST
|
||||||
|
identifier: Run_2
|
||||||
|
spec:
|
||||||
|
connectorRef: account.harnessImage
|
||||||
|
image: golang:1.22.4
|
||||||
|
shell: Sh
|
||||||
|
command: go test -cover ./...
|
||||||
|
- parallel:
|
||||||
|
- stage:
|
||||||
|
name: linux-amd64
|
||||||
|
identifier: linamd64
|
||||||
|
description: ""
|
||||||
|
type: CI
|
||||||
|
spec:
|
||||||
|
cloneCodebase: true
|
||||||
|
caching:
|
||||||
|
enabled: false
|
||||||
|
paths: []
|
||||||
|
platform:
|
||||||
|
os: Linux
|
||||||
|
arch: Amd64
|
||||||
|
runtime:
|
||||||
|
type: Cloud
|
||||||
|
spec: {}
|
||||||
|
execution:
|
||||||
|
steps:
|
||||||
|
- step:
|
||||||
|
type: Run
|
||||||
|
name: Build Binary
|
||||||
|
identifier: Build_Push
|
||||||
|
spec:
|
||||||
|
connectorRef: account.harnessImage
|
||||||
|
image: golang:1.22.4
|
||||||
|
shell: Sh
|
||||||
|
command: <+input>
|
||||||
|
envVariables:
|
||||||
|
CGO_ENABLED: "0"
|
||||||
|
- step:
|
||||||
|
type: Plugin
|
||||||
|
name: Build and Push on Tag
|
||||||
|
identifier: Docker_Build_and_Push
|
||||||
|
spec:
|
||||||
|
connectorRef: Plugins_Docker_Hub_Connector
|
||||||
|
image: plugins/docker
|
||||||
|
settings:
|
||||||
|
username: drone
|
||||||
|
password: <+secrets.getValue("Plugins_Docker_Hub_Pat")>
|
||||||
|
repo: <+input>
|
||||||
|
dockerfile: <+input>
|
||||||
|
auto_tag: "true"
|
||||||
|
auto_tag_suffix: <+input>
|
||||||
|
when:
|
||||||
|
stageStatus: Success
|
||||||
|
condition: <+codebase.build.type> == "tag"
|
||||||
|
- step:
|
||||||
|
type: BuildAndPushDockerRegistry
|
||||||
|
name: Build and Push on Branch
|
||||||
|
identifier: BuildAndPushDockerRegistry_1
|
||||||
|
spec:
|
||||||
|
connectorRef: Plugins_Docker_Hub_Connector
|
||||||
|
repo: <+input>
|
||||||
|
tags: <+input>
|
||||||
|
caching: true
|
||||||
|
dockerfile: <+input>
|
||||||
|
when:
|
||||||
|
stageStatus: Success
|
||||||
|
condition: <+codebase.build.type> == "branch"
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
repo:
|
||||||
|
- docker
|
||||||
|
- gcr
|
||||||
|
- gar
|
||||||
|
- ecr
|
||||||
|
- heroku
|
||||||
|
- acr
|
||||||
|
- stage:
|
||||||
|
name: linux-arm64
|
||||||
|
identifier: linarm64
|
||||||
|
description: ""
|
||||||
|
type: CI
|
||||||
|
spec:
|
||||||
|
cloneCodebase: true
|
||||||
|
caching:
|
||||||
|
enabled: false
|
||||||
|
paths: []
|
||||||
|
platform:
|
||||||
|
os: Linux
|
||||||
|
arch: Arm64
|
||||||
|
runtime:
|
||||||
|
type: Cloud
|
||||||
|
spec: {}
|
||||||
|
execution:
|
||||||
|
steps:
|
||||||
|
- step:
|
||||||
|
type: Run
|
||||||
|
name: Build Binary
|
||||||
|
identifier: buildpush
|
||||||
|
spec:
|
||||||
|
connectorRef: account.harnessImage
|
||||||
|
image: golang:1.22.4
|
||||||
|
shell: Sh
|
||||||
|
command: <+input>
|
||||||
|
envVariables:
|
||||||
|
CGO_ENABLED: "0"
|
||||||
|
- step:
|
||||||
|
type: Plugin
|
||||||
|
name: Build and Push on Tag
|
||||||
|
identifier: Docker_Build_and_Push
|
||||||
|
spec:
|
||||||
|
connectorRef: Plugins_Docker_Hub_Connector
|
||||||
|
image: plugins/docker
|
||||||
|
settings:
|
||||||
|
username: drone
|
||||||
|
password: <+secrets.getValue("Plugins_Docker_Hub_Pat")>
|
||||||
|
repo: <+input>
|
||||||
|
dockerfile: <+input>
|
||||||
|
auto_tag: "true"
|
||||||
|
auto_tag_suffix: <+input>
|
||||||
|
when:
|
||||||
|
stageStatus: Success
|
||||||
|
condition: <+codebase.build.type> == "tag"
|
||||||
|
- step:
|
||||||
|
type: BuildAndPushDockerRegistry
|
||||||
|
name: Build and Push on Branch
|
||||||
|
identifier: BuildAndPushDockerRegistry_1
|
||||||
|
spec:
|
||||||
|
connectorRef: Plugins_Docker_Hub_Connector
|
||||||
|
repo: <+input>
|
||||||
|
tags: <+input>
|
||||||
|
caching: true
|
||||||
|
dockerfile: <+input>
|
||||||
|
when:
|
||||||
|
stageStatus: Success
|
||||||
|
condition: <+codebase.build.type> == "branch"
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
repo:
|
||||||
|
- docker
|
||||||
|
- gcr
|
||||||
|
- gar
|
||||||
|
- ecr
|
||||||
|
- heroku
|
||||||
|
- acr
|
||||||
|
- stage:
|
||||||
|
name: win-1809-amd64
|
||||||
|
identifier: win1809amd64
|
||||||
|
description: ""
|
||||||
|
type: CI
|
||||||
|
spec:
|
||||||
|
cloneCodebase: true
|
||||||
|
caching:
|
||||||
|
enabled: true
|
||||||
|
infrastructure:
|
||||||
|
type: VM
|
||||||
|
spec:
|
||||||
|
type: Pool
|
||||||
|
spec:
|
||||||
|
poolName: windows-2019
|
||||||
|
os: Windows
|
||||||
|
execution:
|
||||||
|
steps:
|
||||||
|
- step:
|
||||||
|
type: Run
|
||||||
|
name: Build Binary
|
||||||
|
identifier: go_build
|
||||||
|
spec:
|
||||||
|
connectorRef: account.harnessImage
|
||||||
|
image: golang:1.22.4
|
||||||
|
shell: Sh
|
||||||
|
command: |-
|
||||||
|
# disable cgo
|
||||||
|
export CGO_ENABLED=0
|
||||||
|
|
||||||
|
go build -o release/windows/amd64/drone-docker.exe ./cmd/drone-docker
|
||||||
|
go build -o release/windows/amd64/drone-ecr.exe ./cmd/drone-ecr
|
||||||
|
go build -o release/windows/amd64/drone-gcr.exe ./cmd/drone-gcr
|
||||||
|
go build -o release/windows/amd64/drone-acr.exe ./cmd/drone-acr
|
||||||
|
go build -o release/windows/amd64/drone-gar.exe ./cmd/drone-gar
|
||||||
|
- step:
|
||||||
|
type: Plugin
|
||||||
|
name: Build and Push on Tag
|
||||||
|
identifier: Docker_Build_and_Push1
|
||||||
|
spec:
|
||||||
|
connectorRef: Plugins_Docker_Hub_Connector
|
||||||
|
image: plugins/docker
|
||||||
|
settings:
|
||||||
|
username: drone
|
||||||
|
password: <+secrets.getValue("Plugins_Docker_Hub_Pat")>
|
||||||
|
repo: <+input>
|
||||||
|
dockerfile: <+input>
|
||||||
|
auto_tag: "true"
|
||||||
|
auto_tag_suffix: <+input>
|
||||||
|
when:
|
||||||
|
stageStatus: Success
|
||||||
|
condition: <+codebase.build.type> == "tag"
|
||||||
|
- step:
|
||||||
|
type: BuildAndPushDockerRegistry
|
||||||
|
name: Build and Push on Branch
|
||||||
|
identifier: BuildAndPushDockerRegistry_2
|
||||||
|
spec:
|
||||||
|
connectorRef: Plugins_Docker_Hub_Connector
|
||||||
|
repo: <+input>
|
||||||
|
tags: <+input>
|
||||||
|
caching: true
|
||||||
|
dockerfile: <+input>
|
||||||
|
when:
|
||||||
|
stageStatus: Success
|
||||||
|
condition: <+codebase.build.type> == "branch"
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
repo:
|
||||||
|
- docker
|
||||||
|
- gcr
|
||||||
|
- gar
|
||||||
|
- ecr
|
||||||
|
- acr
|
||||||
|
delegateSelectors:
|
||||||
|
- windows-vm
|
||||||
|
- stage:
|
||||||
|
name: win-ltsc2022-amd64
|
||||||
|
identifier: winamd64
|
||||||
|
description: ""
|
||||||
|
type: CI
|
||||||
|
spec:
|
||||||
|
cloneCodebase: true
|
||||||
|
caching:
|
||||||
|
enabled: false
|
||||||
|
paths: []
|
||||||
|
platform:
|
||||||
|
os: Windows
|
||||||
|
arch: Amd64
|
||||||
|
runtime:
|
||||||
|
type: Cloud
|
||||||
|
spec: {}
|
||||||
|
execution:
|
||||||
|
steps:
|
||||||
|
- step:
|
||||||
|
type: Run
|
||||||
|
name: Build Binary -ltsc2022
|
||||||
|
identifier: build_amd64ltsc2022
|
||||||
|
spec:
|
||||||
|
connectorRef: account.harnessImage
|
||||||
|
image: golang:1.22.4
|
||||||
|
shell: Sh
|
||||||
|
command: |-
|
||||||
|
# disable cgo
|
||||||
|
export CGO_ENABLED=0
|
||||||
|
|
||||||
|
go build -o release/windows/amd64/drone-docker.exe ./cmd/drone-docker
|
||||||
|
go build -o release/windows/amd64/drone-ecr.exe ./cmd/drone-ecr
|
||||||
|
go build -o release/windows/amd64/drone-gcr.exe ./cmd/drone-gcr
|
||||||
|
go build -o release/windows/amd64/drone-acr.exe ./cmd/drone-acr
|
||||||
|
go build -o release/windows/amd64/drone-gar.exe ./cmd/drone-gar
|
||||||
|
envVariables:
|
||||||
|
CGO_ENABLED: "0"
|
||||||
|
- step:
|
||||||
|
type: Plugin
|
||||||
|
name: Build and Push on Tag
|
||||||
|
identifier: Docker_Build_and_Push1
|
||||||
|
spec:
|
||||||
|
connectorRef: Plugins_Docker_Hub_Connector
|
||||||
|
image: plugins/docker
|
||||||
|
settings:
|
||||||
|
username: drone
|
||||||
|
password: <+secrets.getValue("Plugins_Docker_Hub_Pat")>
|
||||||
|
repo: <+input>
|
||||||
|
dockerfile: <+input>
|
||||||
|
auto_tag: "true"
|
||||||
|
auto_tag_suffix: <+input>
|
||||||
|
when:
|
||||||
|
stageStatus: Success
|
||||||
|
condition: <+codebase.build.type> == "tag"
|
||||||
|
- step:
|
||||||
|
type: BuildAndPushDockerRegistry
|
||||||
|
name: Build and Push on Branch
|
||||||
|
identifier: BuildAndPushDockerRegistry_2
|
||||||
|
spec:
|
||||||
|
connectorRef: Plugins_Docker_Hub_Connector
|
||||||
|
repo: <+input>
|
||||||
|
tags: <+input>
|
||||||
|
caching: true
|
||||||
|
dockerfile: <+input>
|
||||||
|
when:
|
||||||
|
stageStatus: Success
|
||||||
|
condition: <+codebase.build.type> == "branch"
|
||||||
|
buildIntelligence:
|
||||||
|
enabled: false
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
repo:
|
||||||
|
- docker
|
||||||
|
- gcr
|
||||||
|
- gar
|
||||||
|
- ecr
|
||||||
|
- acr
|
||||||
|
- stage:
|
||||||
|
name: Manifest and Release
|
||||||
|
identifier: Manifest
|
||||||
|
description: ""
|
||||||
|
type: CI
|
||||||
|
spec:
|
||||||
|
cloneCodebase: true
|
||||||
|
caching:
|
||||||
|
enabled: false
|
||||||
|
paths: []
|
||||||
|
execution:
|
||||||
|
steps:
|
||||||
|
- step:
|
||||||
|
type: Plugin
|
||||||
|
name: Manifest
|
||||||
|
identifier: Plugin_1
|
||||||
|
spec:
|
||||||
|
connectorRef: Plugins_Docker_Hub_Connector
|
||||||
|
image: plugins/manifest
|
||||||
|
settings:
|
||||||
|
username: drone
|
||||||
|
password: <+secrets.getValue("Plugins_Docker_Hub_Pat")>
|
||||||
|
auto_tag: "true"
|
||||||
|
ignore_missing: "true"
|
||||||
|
spec: <+input>
|
||||||
|
when:
|
||||||
|
stageStatus: Success
|
||||||
|
condition: <+codebase.build.type> == "tag" || <+codebase.build.type> == "branch"
|
||||||
|
platform:
|
||||||
|
os: Linux
|
||||||
|
arch: Amd64
|
||||||
|
runtime:
|
||||||
|
type: Cloud
|
||||||
|
spec: {}
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
repo:
|
||||||
|
- docker
|
||||||
|
- gcr
|
||||||
|
- gar
|
||||||
|
- ecr
|
||||||
|
- heroku
|
||||||
|
- acr
|
||||||
|
identifier: dronedockerharness
|
||||||
|
projectIdentifier: Drone_Plugins
|
||||||
|
name: drone-docker-harness
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"strings"
|
||||||
|
)
|
||||||
|
|
||||||
|
// CustomStringSliceFlag is like a regular StringSlice flag but with
|
||||||
|
// semicolon as a delimiter
|
||||||
|
type CustomStringSliceFlag struct {
|
||||||
|
Value []string
|
||||||
|
}
|
||||||
|
|
||||||
|
func (f *CustomStringSliceFlag) GetValue() []string {
|
||||||
|
if f.Value == nil {
|
||||||
|
return make([]string, 0)
|
||||||
|
}
|
||||||
|
return f.Value
|
||||||
|
}
|
||||||
|
|
||||||
|
func (f *CustomStringSliceFlag) String() string {
|
||||||
|
if f.Value == nil {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
return strings.Join(f.Value, ";")
|
||||||
|
}
|
||||||
|
|
||||||
|
func (f *CustomStringSliceFlag) Set(v string) error {
|
||||||
|
for _, s := range strings.Split(v, ";") {
|
||||||
|
s = strings.TrimSpace(s)
|
||||||
|
f.Value = append(f.Value, s)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
+39
-26
@@ -151,6 +151,17 @@ func main() {
|
|||||||
Usage: "build args",
|
Usage: "build args",
|
||||||
EnvVar: "PLUGIN_BUILD_ARGS_FROM_ENV",
|
EnvVar: "PLUGIN_BUILD_ARGS_FROM_ENV",
|
||||||
},
|
},
|
||||||
|
cli.GenericFlag{
|
||||||
|
Name: "args-new",
|
||||||
|
Usage: "build args new",
|
||||||
|
EnvVar: "PLUGIN_BUILD_ARGS_NEW",
|
||||||
|
Value: new(CustomStringSliceFlag),
|
||||||
|
},
|
||||||
|
cli.BoolFlag{
|
||||||
|
Name: "plugin-multiple-build-agrs",
|
||||||
|
Usage: "plugin multiple build agrs",
|
||||||
|
EnvVar: "PLUGIN_MULTIPLE_BUILD_ARGS",
|
||||||
|
},
|
||||||
cli.BoolFlag{
|
cli.BoolFlag{
|
||||||
Name: "quiet",
|
Name: "quiet",
|
||||||
Usage: "quiet docker build",
|
Usage: "quiet docker build",
|
||||||
@@ -339,32 +350,34 @@ func run(c *cli.Context) error {
|
|||||||
CardPath: c.String("drone-card-path"),
|
CardPath: c.String("drone-card-path"),
|
||||||
ArtifactFile: c.String("artifact-file"),
|
ArtifactFile: c.String("artifact-file"),
|
||||||
Build: docker.Build{
|
Build: docker.Build{
|
||||||
Remote: c.String("remote.url"),
|
Remote: c.String("remote.url"),
|
||||||
Name: c.String("commit.sha"),
|
Name: c.String("commit.sha"),
|
||||||
TempTag: generateTempTag(),
|
TempTag: generateTempTag(),
|
||||||
Dockerfile: c.String("dockerfile"),
|
Dockerfile: c.String("dockerfile"),
|
||||||
Context: c.String("context"),
|
Context: c.String("context"),
|
||||||
Tags: c.StringSlice("tags"),
|
Tags: c.StringSlice("tags"),
|
||||||
Args: c.StringSlice("args"),
|
Args: c.StringSlice("args"),
|
||||||
ArgsEnv: c.StringSlice("args-from-env"),
|
ArgsEnv: c.StringSlice("args-from-env"),
|
||||||
Target: c.String("target"),
|
ArgsNew: c.Generic("args-new").(*CustomStringSliceFlag).GetValue(),
|
||||||
Squash: c.Bool("squash"),
|
IsMultipleBuildArgs: c.Bool("plugin-multiple-build-agrs"),
|
||||||
Pull: c.BoolT("pull-image"),
|
Target: c.String("target"),
|
||||||
CacheFrom: c.StringSlice("cache-from"),
|
Squash: c.Bool("squash"),
|
||||||
Compress: c.Bool("compress"),
|
Pull: c.BoolT("pull-image"),
|
||||||
Repo: c.String("repo"),
|
CacheFrom: c.StringSlice("cache-from"),
|
||||||
Labels: c.StringSlice("custom-labels"),
|
Compress: c.Bool("compress"),
|
||||||
LabelSchema: c.StringSlice("label-schema"),
|
Repo: c.String("repo"),
|
||||||
AutoLabel: c.BoolT("auto-label"),
|
Labels: c.StringSlice("custom-labels"),
|
||||||
Link: c.String("link"),
|
LabelSchema: c.StringSlice("label-schema"),
|
||||||
NoCache: c.Bool("no-cache"),
|
AutoLabel: c.BoolT("auto-label"),
|
||||||
Secret: c.String("secret"),
|
Link: c.String("link"),
|
||||||
SecretEnvs: c.StringSlice("secrets-from-env"),
|
NoCache: c.Bool("no-cache"),
|
||||||
SecretFiles: c.StringSlice("secrets-from-file"),
|
Secret: c.String("secret"),
|
||||||
AddHost: c.StringSlice("add-host"),
|
SecretEnvs: c.StringSlice("secrets-from-env"),
|
||||||
Quiet: c.Bool("quiet"),
|
SecretFiles: c.StringSlice("secrets-from-file"),
|
||||||
Platform: c.String("platform"),
|
AddHost: c.StringSlice("add-host"),
|
||||||
SSHAgentKey: c.String("ssh-agent-key"),
|
Quiet: c.Bool("quiet"),
|
||||||
|
Platform: c.String("platform"),
|
||||||
|
SSHAgentKey: c.String("ssh-agent-key"),
|
||||||
},
|
},
|
||||||
Daemon: docker.Daemon{
|
Daemon: docker.Daemon{
|
||||||
Registry: c.String("docker.registry"),
|
Registry: c.String("docker.registry"),
|
||||||
|
|||||||
@@ -45,33 +45,35 @@ type (
|
|||||||
|
|
||||||
// Build defines Docker build parameters.
|
// Build defines Docker build parameters.
|
||||||
Build struct {
|
Build struct {
|
||||||
Remote string // Git remote URL
|
Remote string // Git remote URL
|
||||||
Name string // Docker build using default named tag
|
Name string // Docker build using default named tag
|
||||||
TempTag string // Temporary tag used during docker build
|
TempTag string // Temporary tag used during docker build
|
||||||
Dockerfile string // Docker build Dockerfile
|
Dockerfile string // Docker build Dockerfile
|
||||||
Context string // Docker build context
|
Context string // Docker build context
|
||||||
Tags []string // Docker build tags
|
Tags []string // Docker build tags
|
||||||
Args []string // Docker build args
|
Args []string // Docker build args
|
||||||
ArgsEnv []string // Docker build args from env
|
ArgsEnv []string // Docker build args from env
|
||||||
Target string // Docker build target
|
ArgsNew []string // docker build args which has comma seperated values
|
||||||
Squash bool // Docker build squash
|
IsMultipleBuildArgs bool // env variable for fall back to old build args
|
||||||
Pull bool // Docker build pull
|
Target string // Docker build target
|
||||||
CacheFrom []string // Docker build cache-from
|
Squash bool // Docker build squash
|
||||||
Compress bool // Docker build compress
|
Pull bool // Docker build pull
|
||||||
Repo string // Docker build repository
|
CacheFrom []string // Docker build cache-from
|
||||||
LabelSchema []string // label-schema Label map
|
Compress bool // Docker build compress
|
||||||
AutoLabel bool // auto-label bool
|
Repo string // Docker build repository
|
||||||
Labels []string // Label map
|
LabelSchema []string // label-schema Label map
|
||||||
Link string // Git repo link
|
AutoLabel bool // auto-label bool
|
||||||
NoCache bool // Docker build no-cache
|
Labels []string // Label map
|
||||||
Secret string // secret keypair
|
Link string // Git repo link
|
||||||
SecretEnvs []string // Docker build secrets with env var as source
|
NoCache bool // Docker build no-cache
|
||||||
SecretFiles []string // Docker build secrets with file as source
|
Secret string // secret keypair
|
||||||
AddHost []string // Docker build add-host
|
SecretEnvs []string // Docker build secrets with env var as source
|
||||||
Quiet bool // Docker build quiet
|
SecretFiles []string // Docker build secrets with file as source
|
||||||
Platform string // Docker build platform
|
AddHost []string // Docker build add-host
|
||||||
SSHAgentKey string // Docker build ssh agent key
|
Quiet bool // Docker build quiet
|
||||||
SSHKeyPath string // Docker build ssh key path
|
Platform string // Docker build platform
|
||||||
|
SSHAgentKey string // Docker build ssh agent key
|
||||||
|
SSHKeyPath string // Docker build ssh key path
|
||||||
}
|
}
|
||||||
|
|
||||||
// Plugin defines the Docker plugin parameters.
|
// Plugin defines the Docker plugin parameters.
|
||||||
@@ -118,8 +120,6 @@ type (
|
|||||||
|
|
||||||
// Exec executes the plugin step
|
// Exec executes the plugin step
|
||||||
func (p Plugin) Exec() error {
|
func (p Plugin) Exec() error {
|
||||||
fmt.Println("sleeping - run the docker daemon and the docker login command")
|
|
||||||
time.Sleep(3000 * time.Second)
|
|
||||||
// start the Docker daemon server
|
// start the Docker daemon server
|
||||||
if !p.Daemon.Disabled {
|
if !p.Daemon.Disabled {
|
||||||
p.startDaemon()
|
p.startDaemon()
|
||||||
@@ -415,8 +415,14 @@ func commandBuild(build Build) *exec.Cmd {
|
|||||||
for _, arg := range build.ArgsEnv {
|
for _, arg := range build.ArgsEnv {
|
||||||
addProxyValue(&build, arg)
|
addProxyValue(&build, arg)
|
||||||
}
|
}
|
||||||
for _, arg := range build.Args {
|
if build.IsMultipleBuildArgs {
|
||||||
args = append(args, "--build-arg", arg)
|
for _, arg := range build.ArgsNew {
|
||||||
|
args = append(args, "--build-arg", arg)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for _, arg := range build.Args {
|
||||||
|
args = append(args, "--build-arg", arg)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
for _, host := range build.AddHost {
|
for _, host := range build.AddHost {
|
||||||
args = append(args, "--add-host", host)
|
args = append(args, "--add-host", host)
|
||||||
@@ -521,6 +527,10 @@ func addProxyValue(build *Build, key string) {
|
|||||||
build.Args = append(build.Args, fmt.Sprintf("%s=%s", key, value))
|
build.Args = append(build.Args, fmt.Sprintf("%s=%s", key, value))
|
||||||
build.Args = append(build.Args, fmt.Sprintf("%s=%s", strings.ToUpper(key), value))
|
build.Args = append(build.Args, fmt.Sprintf("%s=%s", strings.ToUpper(key), value))
|
||||||
}
|
}
|
||||||
|
if len(value) > 0 && !hasProxyBuildArgNew(build, key) {
|
||||||
|
build.ArgsNew = append(build.ArgsNew, fmt.Sprintf("%s=%s", key, value))
|
||||||
|
build.ArgsNew = append(build.ArgsNew, fmt.Sprintf("%s=%s", strings.ToUpper(key), value))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// helper function to get a proxy value from the environment.
|
// helper function to get a proxy value from the environment.
|
||||||
@@ -548,6 +558,17 @@ func hasProxyBuildArg(build *Build, key string) bool {
|
|||||||
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
func hasProxyBuildArgNew(build *Build, key string) bool {
|
||||||
|
keyUpper := strings.ToUpper(key)
|
||||||
|
|
||||||
|
for _, s := range build.ArgsNew {
|
||||||
|
if strings.HasPrefix(s, key) || strings.HasPrefix(s, keyUpper) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
// helper function to create the docker tag command.
|
// helper function to create the docker tag command.
|
||||||
func commandTag(build Build, tag string) *exec.Cmd {
|
func commandTag(build Build, tag string) *exec.Cmd {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
FROM docker:20.10.14-dind
|
FROM docker:27.3.1-dind
|
||||||
|
|
||||||
ENV DOCKER_HOST=unix:///var/run/docker.sock
|
ENV DOCKER_HOST=unix:///var/run/docker.sock
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
FROM arm64v8/docker:20.10.14-dind
|
FROM arm64v8/docker:27.3.1-dind
|
||||||
|
|
||||||
ENV DOCKER_HOST=unix:///var/run/docker.sock
|
ENV DOCKER_HOST=unix:///var/run/docker.sock
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user