Compare commits

..

10 Commits

Author SHA1 Message Date
raghavharness fbf27e6dc1 feat: [CI-17953]: Add warning if base image connector is not provided 2025-07-09 15:01:31 +05:30
ebtasam-faridy be488f7c55 feat: [CI-16559]: docker base image up (#488)
* feat: [CI-16559]: docker base image up

* feat: [CI-16559]: changing base img
2025-06-18 16:28:31 +05:30
ompragash.viswanathan@harness.io 256ec37505 Update pipeline drone-docker-harness 2025-06-18 13:59:07 +05:30
ci-reporunner 3e49e16f0d Update pipeline drone-docker-harness (#491)
Co-authored-by: ompragash.viswanathan@harness.io <ompragash.viswanathan@harness.io>
2025-06-18 13:45:00 +05:30
ci-reporunner d6c64364c4 Update pipeline drone-docker-harness (#490)
Co-authored-by: ompragash.viswanathan@harness.io <ompragash.viswanathan@harness.io>
2025-06-11 20:10:10 +05:30
ompragash.viswanathan@harness.io 8c5277ae89 Update pipeline drone-docker-harness 2025-03-26 20:51:49 +05:30
ci-reporunner 385bfe2f7b Update pipeline drone-docker-harness (#483)
* Update pipeline drone-docker-harness

* Update pipeline drone-docker-harness

* Update pipeline drone-docker-harness

---------

Co-authored-by: ompragash.viswanathan@harness.io <ompragash.viswanathan@harness.io>
2025-03-26 20:49:54 +05:30
ci-reporunner ffa3212940 Update pipeline drone-docker-harness (#482)
* Update pipeline drone-docker-harness

* Update pipeline drone-docker-harness

---------

Co-authored-by: ompragash.viswanathan@harness.io <ompragash.viswanathan@harness.io>
2025-03-26 19:28:29 +05:30
OP (oppenheimer) 78fc38da63 feat: [CI-16478]: Add Azure Container Registry (ACR) authentication support (#480)
* Updated cmd/drone-acr/main.go and the dependencies

* Updated cmd/drone-acr/main.go

* Import path/filepath
2025-03-26 18:34:28 +05:30
ci-reporunner 57234fcfd0 Update pipeline drone-docker-harness: Add matrix strategy at step level. (#481)
* Update pipeline drone-docker-harness

* Update pipeline drone-docker-harness

* Update pipeline drone-docker-harness: Add matrix strategy at step level.

* Update inputset event-Push

* Update inputset event-Tag

* Update inputset event-PR

---------

Co-authored-by: ompragash.viswanathan@harness.io <ompragash.viswanathan@harness.io>
Co-authored-by: Devansh Mathur <devanshmathur@harness.io>
2025-03-26 16:23:45 +05:30
9 changed files with 203 additions and 466 deletions
+30 -30
View File
@@ -12,7 +12,7 @@ platform:
steps: steps:
- name: vet - name: vet
image: golang:1.22.4 image: golang:1.23
commands: commands:
- go vet ./... - go vet ./...
environment: environment:
@@ -22,7 +22,7 @@ steps:
path: /go path: /go
- name: test - name: test
image: golang:1.22.4 image: golang:1.23
commands: commands:
- go test -cover ./... - go test -cover ./...
environment: environment:
@@ -55,7 +55,7 @@ platform:
steps: steps:
- name: go build - name: go build
image: golang:1.22.4 image: golang:1.23
environment: environment:
CGO_ENABLED: 0 CGO_ENABLED: 0
commands: commands:
@@ -162,7 +162,7 @@ platform:
steps: steps:
- name: go build - name: go build
image: golang:1.22.7 image: golang:1.23
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.7 image: golang:1.23
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.7 image: golang:1.23
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.7 image: golang:1.23
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.7 image: golang:1.23
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.7 image: golang:1.23
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.7 image: golang:1.23
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.7 image: golang:1.23
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.7 image: golang:1.23
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.7 image: golang:1.23
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.7 image: golang:1.23
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.7 image: golang:1.23
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.7 image: golang:1.23
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.7 image: golang:1.23
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.7 image: golang:1.23
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.7 image: golang:1.23
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.7 image: golang:1.23
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.7 image: golang:1.23
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.7 image: golang:1.23
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.7 image: golang:1.23
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.7 image: golang:1.23
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.7 image: golang:1.23
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.7 image: golang:1.23
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.7 image: golang:1.23
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.7 image: golang:1.23
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.7 image: golang:1.23
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.7 image: golang:1.23
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:
-112
View File
@@ -13,115 +13,3 @@ inputSet:
type: PR type: PR
spec: spec:
number: <+trigger.prNumber> number: <+trigger.prNumber>
stages:
- parallel:
- 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
-112
View File
@@ -13,115 +13,3 @@ inputSet:
type: branch type: branch
spec: spec:
branch: <+trigger.branch> branch: <+trigger.branch>
stages:
- parallel:
- 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
-112
View File
@@ -13,115 +13,3 @@ inputSet:
type: tag type: tag
spec: spec:
tag: <+trigger.tag> tag: <+trigger.tag>
stages:
- parallel:
- 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
+162 -97
View File
@@ -32,8 +32,8 @@ pipeline:
name: GO VET name: GO VET
identifier: Run_1 identifier: Run_1
spec: spec:
connectorRef: account.harnessImage connectorRef: Plugins_Docker_Hub_Connector
image: golang:1.22.4 image: golang:1.23.0
shell: Sh shell: Sh
command: go vet ./... command: go vet ./...
- step: - step:
@@ -41,8 +41,8 @@ pipeline:
name: GO TEST name: GO TEST
identifier: Run_2 identifier: Run_2
spec: spec:
connectorRef: account.harnessImage connectorRef: Plugins_Docker_Hub_Connector
image: golang:1.22.4 image: golang:1.23.0
shell: Sh shell: Sh
command: go test -cover ./... command: go test -cover ./...
- parallel: - parallel:
@@ -69,12 +69,21 @@ pipeline:
name: Build Binary name: Build Binary
identifier: Build_Push identifier: Build_Push
spec: spec:
connectorRef: account.harnessImage connectorRef: Plugins_Docker_Hub_Connector
image: golang:1.22.4 image: golang:1.23.0
shell: Sh shell: Sh
command: <+input> command: go build -a -tags netgo -o release/linux/amd64/drone-<+matrix.repo> ./cmd/drone-<+matrix.repo>
envVariables: envVariables:
CGO_ENABLED: "0" CGO_ENABLED: "0"
strategy:
matrix:
repo:
- docker
- gcr
- gar
- ecr
- heroku
- acr
- step: - step:
type: Plugin type: Plugin
name: Build and Push on Tag name: Build and Push on Tag
@@ -85,35 +94,45 @@ pipeline:
settings: settings:
username: drone username: drone
password: <+secrets.getValue("Plugins_Docker_Hub_Pat")> password: <+secrets.getValue("Plugins_Docker_Hub_Pat")>
repo: <+input> repo: plugins/<+matrix.repo>
dockerfile: <+input> dockerfile: docker/<+matrix.repo>/Dockerfile.linux.amd64
auto_tag: "true" auto_tag: "true"
auto_tag_suffix: <+input> auto_tag_suffix: linux-amd64
when: when:
stageStatus: Success stageStatus: Success
condition: <+codebase.build.type> == "tag" condition: <+codebase.build.type> == "tag"
strategy:
matrix:
repo:
- docker
- gcr
- gar
- ecr
- heroku
- acr
- step: - step:
type: BuildAndPushDockerRegistry type: BuildAndPushDockerRegistry
name: Build and Push on Branch name: Build and Push on Branch
identifier: BuildAndPushDockerRegistry_1 identifier: BuildAndPushDockerRegistry_1
spec: spec:
connectorRef: Plugins_Docker_Hub_Connector connectorRef: Plugins_Docker_Hub_Connector
repo: <+input> repo: plugins/<+matrix.repo>
tags: <+input> tags:
caching: true - linux-amd64
dockerfile: <+input> caching: false
dockerfile: docker/<+matrix.repo>/Dockerfile.linux.amd64
when: when:
stageStatus: Success stageStatus: Success
condition: <+codebase.build.type> == "branch" condition: <+codebase.build.type> == "branch"
strategy: strategy:
matrix: matrix:
repo: repo:
- docker - docker
- gcr - gcr
- gar - gar
- ecr - ecr
- heroku - heroku
- acr - acr
- stage: - stage:
name: linux-arm64 name: linux-arm64
identifier: linarm64 identifier: linarm64
@@ -137,12 +156,21 @@ pipeline:
name: Build Binary name: Build Binary
identifier: buildpush identifier: buildpush
spec: spec:
connectorRef: account.harnessImage connectorRef: Plugins_Docker_Hub_Connector
image: golang:1.22.4 image: golang:1.23.0
shell: Sh shell: Sh
command: <+input> command: go build -a -tags netgo -o release/linux/arm64/drone-<+matrix.repo> ./cmd/drone-<+matrix.repo>
envVariables: envVariables:
CGO_ENABLED: "0" CGO_ENABLED: "0"
strategy:
matrix:
repo:
- docker
- gcr
- gar
- ecr
- heroku
- acr
- step: - step:
type: Plugin type: Plugin
name: Build and Push on Tag name: Build and Push on Tag
@@ -153,35 +181,45 @@ pipeline:
settings: settings:
username: drone username: drone
password: <+secrets.getValue("Plugins_Docker_Hub_Pat")> password: <+secrets.getValue("Plugins_Docker_Hub_Pat")>
repo: <+input> repo: plugins/<+matrix.repo>
dockerfile: <+input> dockerfile: docker/<+matrix.repo>/Dockerfile.linux.arm64
auto_tag: "true" auto_tag: "true"
auto_tag_suffix: <+input> auto_tag_suffix: linux-arm64
when: when:
stageStatus: Success stageStatus: Success
condition: <+codebase.build.type> == "tag" condition: <+codebase.build.type> == "tag"
strategy:
matrix:
repo:
- docker
- gcr
- gar
- ecr
- heroku
- acr
- step: - step:
type: BuildAndPushDockerRegistry type: BuildAndPushDockerRegistry
name: Build and Push on Branch name: Build and Push on Branch
identifier: BuildAndPushDockerRegistry_1 identifier: BuildAndPushDockerRegistry_1
spec: spec:
connectorRef: Plugins_Docker_Hub_Connector connectorRef: Plugins_Docker_Hub_Connector
repo: <+input> repo: plugins/<+matrix.repo>
tags: <+input> tags:
caching: true - linux-arm64
dockerfile: <+input> caching: false
dockerfile: docker/<+matrix.repo>/Dockerfile.linux.arm64
when: when:
stageStatus: Success stageStatus: Success
condition: <+codebase.build.type> == "branch" condition: <+codebase.build.type> == "branch"
strategy: strategy:
matrix: matrix:
repo: repo:
- docker - docker
- gcr - gcr
- gar - gar
- ecr - ecr
- heroku - heroku
- acr - acr
- stage: - stage:
name: win-1809-amd64 name: win-1809-amd64
identifier: win1809amd64 identifier: win1809amd64
@@ -205,18 +243,22 @@ pipeline:
name: Build Binary name: Build Binary
identifier: go_build identifier: go_build
spec: spec:
connectorRef: account.harnessImage connectorRef: Plugins_Docker_Hub_Connector
image: golang:1.22.4 image: golang:1.23.0
shell: Sh shell: Sh
command: |- command: |-
# disable cgo # disable cgo
export CGO_ENABLED=0 export CGO_ENABLED=0
go build -o release/windows/amd64/drone-docker.exe ./cmd/drone-docker go build -o release/windows/amd64/drone-<+matrix.repo>.exe ./cmd/drone-<+matrix.repo>
go build -o release/windows/amd64/drone-ecr.exe ./cmd/drone-ecr strategy:
go build -o release/windows/amd64/drone-gcr.exe ./cmd/drone-gcr matrix:
go build -o release/windows/amd64/drone-acr.exe ./cmd/drone-acr repo:
go build -o release/windows/amd64/drone-gar.exe ./cmd/drone-gar - docker
- gcr
- gar
- ecr
- acr
- step: - step:
type: Plugin type: Plugin
name: Build and Push on Tag name: Build and Push on Tag
@@ -227,34 +269,43 @@ pipeline:
settings: settings:
username: drone username: drone
password: <+secrets.getValue("Plugins_Docker_Hub_Pat")> password: <+secrets.getValue("Plugins_Docker_Hub_Pat")>
repo: <+input> repo: plugins/<+matrix.repo>
dockerfile: <+input> dockerfile: docker/<+matrix.repo>/Dockerfile.windows.amd64.1809
auto_tag: "true" auto_tag: "true"
auto_tag_suffix: <+input> auto_tag_suffix: windows-1809-amd64
when: when:
stageStatus: Success stageStatus: Success
condition: <+codebase.build.type> == "tag" condition: <+codebase.build.type> == "tag"
strategy:
matrix:
repo:
- docker
- gcr
- gar
- ecr
- acr
- step: - step:
type: BuildAndPushDockerRegistry type: BuildAndPushDockerRegistry
name: Build and Push on Branch name: Build and Push on Branch
identifier: BuildAndPushDockerRegistry_2 identifier: BuildAndPushDockerRegistry_2
spec: spec:
connectorRef: Plugins_Docker_Hub_Connector connectorRef: Plugins_Docker_Hub_Connector
repo: <+input> repo: plugins/<+matrix.repo>
tags: <+input> tags:
caching: true - windows-1809-amd64
dockerfile: <+input> caching: false
dockerfile: docker/<+matrix.repo>/Dockerfile.windows.amd64.1809
when: when:
stageStatus: Success stageStatus: Success
condition: <+codebase.build.type> == "branch" condition: <+codebase.build.type> == "branch"
strategy: strategy:
matrix: matrix:
repo: repo:
- docker - docker
- gcr - gcr
- gar - gar
- ecr - ecr
- acr - acr
delegateSelectors: delegateSelectors:
- windows-vm - windows-vm
- stage: - stage:
@@ -280,20 +331,24 @@ pipeline:
name: Build Binary -ltsc2022 name: Build Binary -ltsc2022
identifier: build_amd64ltsc2022 identifier: build_amd64ltsc2022
spec: spec:
connectorRef: account.harnessImage connectorRef: Plugins_Docker_Hub_Connector
image: golang:1.22.4 image: golang:1.23.0
shell: Sh shell: Sh
command: |- command: |-
# disable cgo # disable cgo
export CGO_ENABLED=0 export CGO_ENABLED=0
go build -o release/windows/amd64/drone-docker.exe ./cmd/drone-docker go build -o release/windows/amd64/drone-<+matrix.repo>.exe ./cmd/drone-<+matrix.repo>
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: envVariables:
CGO_ENABLED: "0" CGO_ENABLED: "0"
strategy:
matrix:
repo:
- docker
- gcr
- gar
- ecr
- acr
- step: - step:
type: Plugin type: Plugin
name: Build and Push on Tag name: Build and Push on Tag
@@ -304,36 +359,45 @@ pipeline:
settings: settings:
username: drone username: drone
password: <+secrets.getValue("Plugins_Docker_Hub_Pat")> password: <+secrets.getValue("Plugins_Docker_Hub_Pat")>
repo: <+input> repo: plugins/<+matrix.repo>
dockerfile: <+input> dockerfile: docker/<+matrix.repo>/Dockerfile.windows.amd64.ltsc2022
auto_tag: "true" auto_tag: "true"
auto_tag_suffix: <+input> auto_tag_suffix: windows-ltsc2022-amd64
when: when:
stageStatus: Success stageStatus: Success
condition: <+codebase.build.type> == "tag" condition: <+codebase.build.type> == "tag"
strategy:
matrix:
repo:
- docker
- gcr
- gar
- ecr
- acr
- step: - step:
type: BuildAndPushDockerRegistry type: BuildAndPushDockerRegistry
name: Build and Push on Branch name: Build and Push on Branch
identifier: BuildAndPushDockerRegistry_2 identifier: BuildAndPushDockerRegistry_2
spec: spec:
connectorRef: Plugins_Docker_Hub_Connector connectorRef: Plugins_Docker_Hub_Connector
repo: <+input> repo: plugins/<+matrix.repo>
tags: <+input> tags:
caching: true - windows-ltsc2022-amd64
dockerfile: <+input> caching: false
dockerfile: docker/<+matrix.repo>/Dockerfile.windows.amd64.ltsc2022
when: when:
stageStatus: Success stageStatus: Success
condition: <+codebase.build.type> == "branch" condition: <+codebase.build.type> == "branch"
strategy:
matrix:
repo:
- docker
- gcr
- gar
- ecr
- acr
buildIntelligence: buildIntelligence:
enabled: false enabled: false
strategy:
matrix:
repo:
- docker
- gcr
- gar
- ecr
- acr
- stage: - stage:
name: Manifest and Release name: Manifest and Release
identifier: Manifest identifier: Manifest
@@ -358,25 +422,26 @@ pipeline:
password: <+secrets.getValue("Plugins_Docker_Hub_Pat")> password: <+secrets.getValue("Plugins_Docker_Hub_Pat")>
auto_tag: "true" auto_tag: "true"
ignore_missing: "true" ignore_missing: "true"
spec: <+input> spec: docker/<+matrix.repo>/manifest.tmpl
when: when:
stageStatus: Success stageStatus: Success
condition: <+codebase.build.type> == "tag" || <+codebase.build.type> == "branch" condition: <+codebase.build.type> == "tag"
strategy:
matrix:
repo:
- docker
- gcr
- gar
- ecr
- heroku
- acr
platform: platform:
os: Linux os: Linux
arch: Amd64 arch: Amd64
runtime: runtime:
type: Cloud type: Cloud
spec: {} spec: {}
strategy:
matrix:
repo:
- docker
- gcr
- gar
- ecr
- heroku
- acr
identifier: dronedockerharness identifier: dronedockerharness
projectIdentifier: Drone_Plugins projectIdentifier: Drone_Plugins
name: drone-docker-harness name: drone-docker-harness
allowStageExecutions: true
+6 -1
View File
@@ -10,6 +10,7 @@ import (
"net/url" "net/url"
"os" "os"
"os/exec" "os/exec"
"path/filepath"
"strings" "strings"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
@@ -28,7 +29,7 @@ type subscriptionUrlResponse struct {
} }
const ( const (
acrCertPath = "/tmp/acr-cert.pem" acrCertFile = "acr-cert.pem"
azSubscriptionApiVersion = "2021-04-01" azSubscriptionApiVersion = "2021-04-01"
azSubscriptionBaseUrl = "https://management.azure.com/subscriptions/" azSubscriptionBaseUrl = "https://management.azure.com/subscriptions/"
basePublicUrl = "https://portal.azure.com/#view/Microsoft_Azure_ContainerRegistries/TagMetadataBlade/registryId/" basePublicUrl = "https://portal.azure.com/#view/Microsoft_Azure_ContainerRegistries/TagMetadataBlade/registryId/"
@@ -41,6 +42,10 @@ const (
certPathEnv = "AZURE_CLIENT_CERTIFICATE_PATH" certPathEnv = "AZURE_CLIENT_CERTIFICATE_PATH"
) )
var (
acrCertPath = filepath.Join(os.TempDir(), acrCertFile)
)
func main() { func main() {
// Load env-file if it exists first // Load env-file if it exists first
if env := os.Getenv("PLUGIN_ENV_FILE"); env != "" { if env := os.Getenv("PLUGIN_ENV_FILE"); env != "" {
+3
View File
@@ -193,6 +193,9 @@ func (p Plugin) Exec() error {
fmt.Println(out) fmt.Println(out)
return fmt.Errorf("Error authenticating base connector: exit status 1") return fmt.Errorf("Error authenticating base connector: exit status 1")
} }
} else {
fmt.Println("\033[33mTo ensure consistent and reliable pipeline execution, we recommend setting up a Base Image Connector.\033[0m\n" +
"\033[33mWhile optional at this time, configuring it helps prevent failures caused by Docker Hub's rate limits.\033[0m")
} }
// login to the Docker registry // login to the Docker registry
+1 -1
View File
@@ -1,4 +1,4 @@
FROM docker:20.10.14-dind FROM docker:28.1.1-dind
ENV DOCKER_HOST=unix:///var/run/docker.sock ENV DOCKER_HOST=unix:///var/run/docker.sock
+1 -1
View File
@@ -1,4 +1,4 @@
FROM arm64v8/docker:20.10.14-dind FROM arm64v8/docker:28.1.1-dind
ENV DOCKER_HOST=unix:///var/run/docker.sock ENV DOCKER_HOST=unix:///var/run/docker.sock