mirror of
https://github.com/drone-plugins/drone-docker.git
synced 2026-06-14 05:13:02 +08:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 55522cce76 |
+286
-285
@@ -45,294 +45,295 @@ pipeline:
|
|||||||
image: golang:1.22.4
|
image: golang:1.22.4
|
||||||
shell: Sh
|
shell: Sh
|
||||||
command: go test -cover ./...
|
command: go test -cover ./...
|
||||||
- stage:
|
- parallel:
|
||||||
name: linux-amd64
|
- stage:
|
||||||
identifier: linamd64
|
name: linux-amd64
|
||||||
description: ""
|
identifier: linamd64
|
||||||
type: CI
|
description: ""
|
||||||
spec:
|
type: CI
|
||||||
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:
|
spec:
|
||||||
type: Pool
|
cloneCodebase: true
|
||||||
spec:
|
caching:
|
||||||
poolName: windows-2019
|
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
|
os: Windows
|
||||||
execution:
|
arch: Amd64
|
||||||
steps:
|
runtime:
|
||||||
- step:
|
type: Cloud
|
||||||
type: Run
|
spec: {}
|
||||||
name: Build Binary
|
execution:
|
||||||
identifier: go_build
|
steps:
|
||||||
spec:
|
- step:
|
||||||
connectorRef: account.harnessImage
|
type: Run
|
||||||
image: golang:1.22.4
|
name: Build Binary -ltsc2022
|
||||||
shell: Sh
|
identifier: build_amd64ltsc2022
|
||||||
command: |-
|
spec:
|
||||||
# disable cgo
|
connectorRef: account.harnessImage
|
||||||
export CGO_ENABLED=0
|
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-docker.exe ./cmd/drone-docker
|
||||||
go build -o release/windows/amd64/drone-ecr.exe ./cmd/drone-ecr
|
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-gcr.exe ./cmd/drone-gcr
|
||||||
go build -o release/windows/amd64/drone-acr.exe ./cmd/drone-acr
|
go build -o release/windows/amd64/drone-acr.exe ./cmd/drone-acr
|
||||||
go build -o release/windows/amd64/drone-gar.exe ./cmd/drone-gar
|
go build -o release/windows/amd64/drone-gar.exe ./cmd/drone-gar
|
||||||
- step:
|
envVariables:
|
||||||
type: Plugin
|
CGO_ENABLED: "0"
|
||||||
name: Build and Push on Tag
|
- step:
|
||||||
identifier: Docker_Build_and_Push1
|
type: Plugin
|
||||||
spec:
|
name: Build and Push on Tag
|
||||||
connectorRef: Plugins_Docker_Hub_Connector
|
identifier: Docker_Build_and_Push1
|
||||||
image: plugins/docker
|
spec:
|
||||||
settings:
|
connectorRef: Plugins_Docker_Hub_Connector
|
||||||
username: drone
|
image: plugins/docker
|
||||||
password: <+secrets.getValue("Plugins_Docker_Hub_Pat")>
|
settings:
|
||||||
repo: <+input>
|
username: drone
|
||||||
dockerfile: <+input>
|
password: <+secrets.getValue("Plugins_Docker_Hub_Pat")>
|
||||||
auto_tag: "true"
|
repo: <+input>
|
||||||
auto_tag_suffix: <+input>
|
dockerfile: <+input>
|
||||||
when:
|
auto_tag: "true"
|
||||||
stageStatus: Success
|
auto_tag_suffix: <+input>
|
||||||
condition: <+codebase.build.type> == "tag"
|
when:
|
||||||
- step:
|
stageStatus: Success
|
||||||
type: BuildAndPushDockerRegistry
|
condition: <+codebase.build.type> == "tag"
|
||||||
name: Build and Push on Branch
|
- step:
|
||||||
identifier: BuildAndPushDockerRegistry_2
|
type: BuildAndPushDockerRegistry
|
||||||
spec:
|
name: Build and Push on Branch
|
||||||
connectorRef: Plugins_Docker_Hub_Connector
|
identifier: BuildAndPushDockerRegistry_2
|
||||||
repo: <+input>
|
spec:
|
||||||
tags: <+input>
|
connectorRef: Plugins_Docker_Hub_Connector
|
||||||
caching: true
|
repo: <+input>
|
||||||
dockerfile: <+input>
|
tags: <+input>
|
||||||
when:
|
caching: true
|
||||||
stageStatus: Success
|
dockerfile: <+input>
|
||||||
condition: <+codebase.build.type> == "branch"
|
when:
|
||||||
strategy:
|
stageStatus: Success
|
||||||
matrix:
|
condition: <+codebase.build.type> == "branch"
|
||||||
repo:
|
buildIntelligence:
|
||||||
- docker
|
enabled: false
|
||||||
- gcr
|
strategy:
|
||||||
- gar
|
matrix:
|
||||||
- ecr
|
repo:
|
||||||
- acr
|
- docker
|
||||||
delegateSelectors:
|
- gcr
|
||||||
- windows-vm
|
- gar
|
||||||
- stage:
|
- ecr
|
||||||
name: win-ltsc2022-amd64
|
- acr
|
||||||
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:
|
- stage:
|
||||||
name: Manifest and Release
|
name: Manifest and Release
|
||||||
identifier: Manifest
|
identifier: Manifest
|
||||||
|
|||||||
Reference in New Issue
Block a user