Compare commits

..

1 Commits

Author SHA1 Message Date
Ompragash Viswanathan c4ff01c1e7 Updated cmd/drone-acr/main.go and the dependencies 2025-03-24 13:33:27 +05:30
9 changed files with 466 additions and 203 deletions
+30 -30
View File
@@ -12,7 +12,7 @@ platform:
steps: steps:
- name: vet - name: vet
image: golang:1.23 image: golang:1.22.4
commands: commands:
- go vet ./... - go vet ./...
environment: environment:
@@ -22,7 +22,7 @@ steps:
path: /go path: /go
- name: test - name: test
image: golang:1.23 image: golang:1.22.4
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.23 image: golang:1.22.4
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.23 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.23 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.23 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.23 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.23 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.23 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.23 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.23 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.23 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.23 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.23 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.23 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.23 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.23 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.23 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.23 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.23 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.23 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.23 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.23 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.23 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.23 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.23 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.23 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.23 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.23 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.23 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:
+112
View File
@@ -13,3 +13,115 @@ 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,3 +13,115 @@ 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,3 +13,115 @@ 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
+97 -162
View File
@@ -32,8 +32,8 @@ pipeline:
name: GO VET name: GO VET
identifier: Run_1 identifier: Run_1
spec: spec:
connectorRef: Plugins_Docker_Hub_Connector connectorRef: account.harnessImage
image: golang:1.23.0 image: golang:1.22.4
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: Plugins_Docker_Hub_Connector connectorRef: account.harnessImage
image: golang:1.23.0 image: golang:1.22.4
shell: Sh shell: Sh
command: go test -cover ./... command: go test -cover ./...
- parallel: - parallel:
@@ -69,21 +69,12 @@ pipeline:
name: Build Binary name: Build Binary
identifier: Build_Push identifier: Build_Push
spec: spec:
connectorRef: Plugins_Docker_Hub_Connector connectorRef: account.harnessImage
image: golang:1.23.0 image: golang:1.22.4
shell: Sh shell: Sh
command: go build -a -tags netgo -o release/linux/amd64/drone-<+matrix.repo> ./cmd/drone-<+matrix.repo> command: <+input>
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
@@ -94,45 +85,35 @@ pipeline:
settings: settings:
username: drone username: drone
password: <+secrets.getValue("Plugins_Docker_Hub_Pat")> password: <+secrets.getValue("Plugins_Docker_Hub_Pat")>
repo: plugins/<+matrix.repo> repo: <+input>
dockerfile: docker/<+matrix.repo>/Dockerfile.linux.amd64 dockerfile: <+input>
auto_tag: "true" auto_tag: "true"
auto_tag_suffix: linux-amd64 auto_tag_suffix: <+input>
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: plugins/<+matrix.repo> repo: <+input>
tags: tags: <+input>
- linux-amd64 caching: true
caching: false dockerfile: <+input>
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
@@ -156,21 +137,12 @@ pipeline:
name: Build Binary name: Build Binary
identifier: buildpush identifier: buildpush
spec: spec:
connectorRef: Plugins_Docker_Hub_Connector connectorRef: account.harnessImage
image: golang:1.23.0 image: golang:1.22.4
shell: Sh shell: Sh
command: go build -a -tags netgo -o release/linux/arm64/drone-<+matrix.repo> ./cmd/drone-<+matrix.repo> command: <+input>
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
@@ -181,45 +153,35 @@ pipeline:
settings: settings:
username: drone username: drone
password: <+secrets.getValue("Plugins_Docker_Hub_Pat")> password: <+secrets.getValue("Plugins_Docker_Hub_Pat")>
repo: plugins/<+matrix.repo> repo: <+input>
dockerfile: docker/<+matrix.repo>/Dockerfile.linux.arm64 dockerfile: <+input>
auto_tag: "true" auto_tag: "true"
auto_tag_suffix: linux-arm64 auto_tag_suffix: <+input>
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: plugins/<+matrix.repo> repo: <+input>
tags: tags: <+input>
- linux-arm64 caching: true
caching: false dockerfile: <+input>
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
@@ -243,22 +205,18 @@ pipeline:
name: Build Binary name: Build Binary
identifier: go_build identifier: go_build
spec: spec:
connectorRef: Plugins_Docker_Hub_Connector connectorRef: account.harnessImage
image: golang:1.23.0 image: golang:1.22.4
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-<+matrix.repo>.exe ./cmd/drone-<+matrix.repo> go build -o release/windows/amd64/drone-docker.exe ./cmd/drone-docker
strategy: go build -o release/windows/amd64/drone-ecr.exe ./cmd/drone-ecr
matrix: go build -o release/windows/amd64/drone-gcr.exe ./cmd/drone-gcr
repo: go build -o release/windows/amd64/drone-acr.exe ./cmd/drone-acr
- docker go build -o release/windows/amd64/drone-gar.exe ./cmd/drone-gar
- gcr
- gar
- ecr
- acr
- step: - step:
type: Plugin type: Plugin
name: Build and Push on Tag name: Build and Push on Tag
@@ -269,43 +227,34 @@ pipeline:
settings: settings:
username: drone username: drone
password: <+secrets.getValue("Plugins_Docker_Hub_Pat")> password: <+secrets.getValue("Plugins_Docker_Hub_Pat")>
repo: plugins/<+matrix.repo> repo: <+input>
dockerfile: docker/<+matrix.repo>/Dockerfile.windows.amd64.1809 dockerfile: <+input>
auto_tag: "true" auto_tag: "true"
auto_tag_suffix: windows-1809-amd64 auto_tag_suffix: <+input>
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: plugins/<+matrix.repo> repo: <+input>
tags: tags: <+input>
- windows-1809-amd64 caching: true
caching: false dockerfile: <+input>
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:
@@ -331,24 +280,20 @@ pipeline:
name: Build Binary -ltsc2022 name: Build Binary -ltsc2022
identifier: build_amd64ltsc2022 identifier: build_amd64ltsc2022
spec: spec:
connectorRef: Plugins_Docker_Hub_Connector connectorRef: account.harnessImage
image: golang:1.23.0 image: golang:1.22.4
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-<+matrix.repo>.exe ./cmd/drone-<+matrix.repo> 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: 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
@@ -359,45 +304,36 @@ pipeline:
settings: settings:
username: drone username: drone
password: <+secrets.getValue("Plugins_Docker_Hub_Pat")> password: <+secrets.getValue("Plugins_Docker_Hub_Pat")>
repo: plugins/<+matrix.repo> repo: <+input>
dockerfile: docker/<+matrix.repo>/Dockerfile.windows.amd64.ltsc2022 dockerfile: <+input>
auto_tag: "true" auto_tag: "true"
auto_tag_suffix: windows-ltsc2022-amd64 auto_tag_suffix: <+input>
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: plugins/<+matrix.repo> repo: <+input>
tags: tags: <+input>
- windows-ltsc2022-amd64 caching: true
caching: false dockerfile: <+input>
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
@@ -422,26 +358,25 @@ 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: docker/<+matrix.repo>/manifest.tmpl spec: <+input>
when: when:
stageStatus: Success stageStatus: Success
condition: <+codebase.build.type> == "tag" condition: <+codebase.build.type> == "tag" || <+codebase.build.type> == "branch"
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
+1 -6
View File
@@ -10,7 +10,6 @@ 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"
@@ -29,7 +28,7 @@ type subscriptionUrlResponse struct {
} }
const ( const (
acrCertFile = "acr-cert.pem" acrCertPath = "/tmp/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/"
@@ -42,10 +41,6 @@ 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,9 +193,6 @@ 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:28.1.1-dind FROM docker:20.10.14-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:28.1.1-dind FROM arm64v8/docker:20.10.14-dind
ENV DOCKER_HOST=unix:///var/run/docker.sock ENV DOCKER_HOST=unix:///var/run/docker.sock