mirror of
https://github.com/drone/drone-kaniko.git
synced 2026-06-14 14:02:35 +08:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a61915964f | |||
| b826c7f408 | |||
| e56198f84c | |||
| d6153866df | |||
| 30e1ea9fd8 | |||
| 0fb726616e |
@@ -0,0 +1,14 @@
|
|||||||
|
inputSet:
|
||||||
|
name: event-PR
|
||||||
|
identifier: eventPR
|
||||||
|
orgIdentifier: default
|
||||||
|
projectIdentifier: Drone_Plugins
|
||||||
|
pipeline:
|
||||||
|
identifier: dronekanikoharness
|
||||||
|
properties:
|
||||||
|
ci:
|
||||||
|
codebase:
|
||||||
|
build:
|
||||||
|
type: PR
|
||||||
|
spec:
|
||||||
|
number: <+trigger.prNumber>
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
inputSet:
|
||||||
|
name: event-Push
|
||||||
|
identifier: eventPush
|
||||||
|
orgIdentifier: default
|
||||||
|
projectIdentifier: Drone_Plugins
|
||||||
|
pipeline:
|
||||||
|
identifier: dronekanikoharness
|
||||||
|
properties:
|
||||||
|
ci:
|
||||||
|
codebase:
|
||||||
|
build:
|
||||||
|
type: branch
|
||||||
|
spec:
|
||||||
|
branch: <+trigger.branch>
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
inputSet:
|
||||||
|
name: event-Tag
|
||||||
|
identifier: eventTag
|
||||||
|
orgIdentifier: default
|
||||||
|
projectIdentifier: Drone_Plugins
|
||||||
|
pipeline:
|
||||||
|
identifier: dronekanikoharness
|
||||||
|
properties:
|
||||||
|
ci:
|
||||||
|
codebase:
|
||||||
|
build:
|
||||||
|
type: tag
|
||||||
|
spec:
|
||||||
|
tag: <+trigger.tag>
|
||||||
@@ -0,0 +1,655 @@
|
|||||||
|
pipeline:
|
||||||
|
name: drone-kaniko-harness
|
||||||
|
identifier: dronekanikoharness
|
||||||
|
projectIdentifier: Drone_Plugins
|
||||||
|
orgIdentifier: default
|
||||||
|
tags: {}
|
||||||
|
properties:
|
||||||
|
ci:
|
||||||
|
codebase:
|
||||||
|
connectorRef: GitHub_Drone_Org
|
||||||
|
repoName: drone-kaniko
|
||||||
|
build: <+input>
|
||||||
|
sparseCheckout: []
|
||||||
|
stages:
|
||||||
|
- parallel:
|
||||||
|
- stage:
|
||||||
|
name: linux-amd64
|
||||||
|
identifier: linuxamd64
|
||||||
|
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
|
||||||
|
spec:
|
||||||
|
connectorRef: Plugins_Docker_Hub_Connector
|
||||||
|
image: golang:1.22.4
|
||||||
|
shell: Sh
|
||||||
|
command: |-
|
||||||
|
go test ./...
|
||||||
|
sh scripts/build.sh
|
||||||
|
- parallel:
|
||||||
|
- step:
|
||||||
|
type: Plugin
|
||||||
|
name: BuildAndPushDockerTag
|
||||||
|
identifier: BuildAndPushDockerTag
|
||||||
|
spec:
|
||||||
|
connectorRef: Plugins_Docker_Hub_Connector
|
||||||
|
image: plugins/docker
|
||||||
|
settings:
|
||||||
|
username: drone
|
||||||
|
password: <+secrets.getValue("Plugins_Docker_Hub_Pat")>
|
||||||
|
repo: plugins/kaniko<+matrix.image>
|
||||||
|
dockerfile: docker/<+matrix.repo>/Dockerfile.linux.amd64
|
||||||
|
auto_tag: "true"
|
||||||
|
auto_tag_suffix: linux-amd64
|
||||||
|
daemon_off: "false"
|
||||||
|
when:
|
||||||
|
stageStatus: Success
|
||||||
|
condition: <+codebase.build.type> == "tag"
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
image:
|
||||||
|
- ""
|
||||||
|
- "-gcr"
|
||||||
|
- "-gar"
|
||||||
|
- "-ecr"
|
||||||
|
- "-acr"
|
||||||
|
repo:
|
||||||
|
- docker
|
||||||
|
- gcr
|
||||||
|
- gar
|
||||||
|
- ecr
|
||||||
|
- acr
|
||||||
|
exclude:
|
||||||
|
- image: ""
|
||||||
|
repo: gcr
|
||||||
|
- image: ""
|
||||||
|
repo: gar
|
||||||
|
- image: ""
|
||||||
|
repo: ecr
|
||||||
|
- image: ""
|
||||||
|
repo: acr
|
||||||
|
- image: "-gcr"
|
||||||
|
repo: docker
|
||||||
|
- image: "-gcr"
|
||||||
|
repo: gar
|
||||||
|
- image: "-gcr"
|
||||||
|
repo: ecr
|
||||||
|
- image: "-gcr"
|
||||||
|
repo: acr
|
||||||
|
- image: "-gar"
|
||||||
|
repo: docker
|
||||||
|
- image: "-gar"
|
||||||
|
repo: gcr
|
||||||
|
- image: "-gar"
|
||||||
|
repo: ecr
|
||||||
|
- image: "-gar"
|
||||||
|
repo: acr
|
||||||
|
- image: "-ecr"
|
||||||
|
repo: docker
|
||||||
|
- image: "-ecr"
|
||||||
|
repo: gcr
|
||||||
|
- image: "-ecr"
|
||||||
|
repo: gar
|
||||||
|
- image: "-ecr"
|
||||||
|
repo: acr
|
||||||
|
- image: "-acr"
|
||||||
|
repo: docker
|
||||||
|
- image: "-acr"
|
||||||
|
repo: gcr
|
||||||
|
- image: "-acr"
|
||||||
|
repo: gar
|
||||||
|
- image: "-acr"
|
||||||
|
repo: ecr
|
||||||
|
nodeName: _<+matrix.repo>
|
||||||
|
- step:
|
||||||
|
type: Plugin
|
||||||
|
name: BuildAndPushDockerTag_Kaniko
|
||||||
|
identifier: BuildAndPushDockerTag_Kaniko
|
||||||
|
spec:
|
||||||
|
connectorRef: Plugins_Docker_Hub_Connector
|
||||||
|
image: plugins/docker
|
||||||
|
settings:
|
||||||
|
username: drone
|
||||||
|
password: <+secrets.getValue("Plugins_Docker_Hub_Pat")>
|
||||||
|
repo: plugins/kaniko<+matrix.image>
|
||||||
|
dockerfile: docker/<+matrix.repo>/Dockerfile.linux.amd64.kaniko1.9.1
|
||||||
|
auto_tag: "true"
|
||||||
|
auto_tag_suffix: linux-amd64-kaniko1.9.1
|
||||||
|
daemon_off: "false"
|
||||||
|
when:
|
||||||
|
stageStatus: Success
|
||||||
|
condition: <+codebase.build.type> == "tag"
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
image:
|
||||||
|
- ""
|
||||||
|
- "-gcr"
|
||||||
|
- "-gar"
|
||||||
|
- "-ecr"
|
||||||
|
repo:
|
||||||
|
- docker
|
||||||
|
- gcr
|
||||||
|
- gar
|
||||||
|
- ecr
|
||||||
|
exclude:
|
||||||
|
- image: ""
|
||||||
|
repo: gcr
|
||||||
|
- image: ""
|
||||||
|
repo: gar
|
||||||
|
- image: ""
|
||||||
|
repo: ecr
|
||||||
|
- image: "-gcr"
|
||||||
|
repo: docker
|
||||||
|
- image: "-gcr"
|
||||||
|
repo: gar
|
||||||
|
- image: "-gcr"
|
||||||
|
repo: ecr
|
||||||
|
- image: "-gar"
|
||||||
|
repo: docker
|
||||||
|
- image: "-gar"
|
||||||
|
repo: gcr
|
||||||
|
- image: "-gar"
|
||||||
|
repo: ecr
|
||||||
|
- image: "-ecr"
|
||||||
|
repo: docker
|
||||||
|
- image: "-ecr"
|
||||||
|
repo: gcr
|
||||||
|
- image: "-ecr"
|
||||||
|
repo: gar
|
||||||
|
nodeName: <+matrix.repo>
|
||||||
|
- parallel:
|
||||||
|
- step:
|
||||||
|
type: BuildAndPushDockerRegistry
|
||||||
|
name: BuildAndPushDockerBranch
|
||||||
|
identifier: BuildAndPushDockerBranch
|
||||||
|
spec:
|
||||||
|
connectorRef: Plugins_Docker_Hub_Connector
|
||||||
|
repo: plugins/kaniko<+matrix.image>
|
||||||
|
tags:
|
||||||
|
- linux-amd64
|
||||||
|
caching: false
|
||||||
|
dockerfile: docker/<+matrix.repo>/Dockerfile.linux.amd64
|
||||||
|
when:
|
||||||
|
stageStatus: Success
|
||||||
|
condition: <+codebase.build.type> == "branch"
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
image:
|
||||||
|
- ""
|
||||||
|
- "-gcr"
|
||||||
|
- "-gar"
|
||||||
|
- "-ecr"
|
||||||
|
- "-acr"
|
||||||
|
repo:
|
||||||
|
- docker
|
||||||
|
- gcr
|
||||||
|
- gar
|
||||||
|
- ecr
|
||||||
|
- acr
|
||||||
|
exclude:
|
||||||
|
- image: ""
|
||||||
|
repo: gcr
|
||||||
|
- image: ""
|
||||||
|
repo: gar
|
||||||
|
- image: ""
|
||||||
|
repo: ecr
|
||||||
|
- image: ""
|
||||||
|
repo: acr
|
||||||
|
- image: "-gcr"
|
||||||
|
repo: docker
|
||||||
|
- image: "-gcr"
|
||||||
|
repo: gar
|
||||||
|
- image: "-gcr"
|
||||||
|
repo: ecr
|
||||||
|
- image: "-gcr"
|
||||||
|
repo: acr
|
||||||
|
- image: "-gar"
|
||||||
|
repo: docker
|
||||||
|
- image: "-gar"
|
||||||
|
repo: gcr
|
||||||
|
- image: "-gar"
|
||||||
|
repo: ecr
|
||||||
|
- image: "-gar"
|
||||||
|
repo: acr
|
||||||
|
- image: "-ecr"
|
||||||
|
repo: docker
|
||||||
|
- image: "-ecr"
|
||||||
|
repo: gcr
|
||||||
|
- image: "-ecr"
|
||||||
|
repo: gar
|
||||||
|
- image: "-ecr"
|
||||||
|
repo: acr
|
||||||
|
- image: "-acr"
|
||||||
|
repo: docker
|
||||||
|
- image: "-acr"
|
||||||
|
repo: gcr
|
||||||
|
- image: "-acr"
|
||||||
|
repo: gar
|
||||||
|
- image: "-acr"
|
||||||
|
repo: ecr
|
||||||
|
nodeName: <+matrix.repo>
|
||||||
|
- step:
|
||||||
|
type: BuildAndPushDockerRegistry
|
||||||
|
name: BuildAndPushDockerBranch_Kaniko
|
||||||
|
identifier: BuildAndPushDockerBranch_Kaniko
|
||||||
|
spec:
|
||||||
|
connectorRef: Plugins_Docker_Hub_Connector
|
||||||
|
repo: plugins/kaniko<+matrix.image>
|
||||||
|
tags:
|
||||||
|
- linux-amd64-kaniko1.9.1
|
||||||
|
caching: false
|
||||||
|
dockerfile: docker/<+matrix.repo>/Dockerfile.linux.amd64.kaniko1.9.1
|
||||||
|
when:
|
||||||
|
stageStatus: Success
|
||||||
|
condition: <+codebase.build.type> == "branch"
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
image:
|
||||||
|
- ""
|
||||||
|
- "-gcr"
|
||||||
|
- "-gar"
|
||||||
|
- "-ecr"
|
||||||
|
repo:
|
||||||
|
- docker
|
||||||
|
- gcr
|
||||||
|
- gar
|
||||||
|
- ecr
|
||||||
|
exclude:
|
||||||
|
- image: ""
|
||||||
|
repo: gcr
|
||||||
|
- image: ""
|
||||||
|
repo: gar
|
||||||
|
- image: ""
|
||||||
|
repo: ecr
|
||||||
|
- image: "-gcr"
|
||||||
|
repo: docker
|
||||||
|
- image: "-gcr"
|
||||||
|
repo: gar
|
||||||
|
- image: "-gcr"
|
||||||
|
repo: ecr
|
||||||
|
- image: "-gar"
|
||||||
|
repo: docker
|
||||||
|
- image: "-gar"
|
||||||
|
repo: gcr
|
||||||
|
- image: "-gar"
|
||||||
|
repo: ecr
|
||||||
|
- image: "-ecr"
|
||||||
|
repo: docker
|
||||||
|
- image: "-ecr"
|
||||||
|
repo: gcr
|
||||||
|
- image: "-ecr"
|
||||||
|
repo: gar
|
||||||
|
nodeName: _<+matrix.repo>
|
||||||
|
when:
|
||||||
|
pipelineStatus: Success
|
||||||
|
- stage:
|
||||||
|
name: linux-arm64
|
||||||
|
identifier: linuxarm64
|
||||||
|
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: Build_and_Test
|
||||||
|
spec:
|
||||||
|
connectorRef: Plugins_Docker_Hub_Connector
|
||||||
|
image: golang:1.22.4
|
||||||
|
shell: Sh
|
||||||
|
command: |-
|
||||||
|
go test ./...
|
||||||
|
sh scripts/build.sh
|
||||||
|
- parallel:
|
||||||
|
- step:
|
||||||
|
type: Plugin
|
||||||
|
name: BuildAndPushDockerTag
|
||||||
|
identifier: BuildAndPushDockerTag
|
||||||
|
spec:
|
||||||
|
connectorRef: Plugins_Docker_Hub_Connector
|
||||||
|
image: plugins/docker
|
||||||
|
settings:
|
||||||
|
username: drone
|
||||||
|
password: <+secrets.getValue("Plugins_Docker_Hub_Pat")>
|
||||||
|
repo: plugins/kaniko<+matrix.image>
|
||||||
|
dockerfile: docker/<+matrix.repo>/Dockerfile.linux.arm64
|
||||||
|
auto_tag: "true"
|
||||||
|
auto_tag_suffix: linux-arm64
|
||||||
|
daemon_off: "false"
|
||||||
|
when:
|
||||||
|
stageStatus: Success
|
||||||
|
condition: <+codebase.build.type> == "tag"
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
image:
|
||||||
|
- ""
|
||||||
|
- "-gcr"
|
||||||
|
- "-gar"
|
||||||
|
- "-ecr"
|
||||||
|
- "-acr"
|
||||||
|
repo:
|
||||||
|
- docker
|
||||||
|
- gcr
|
||||||
|
- gar
|
||||||
|
- ecr
|
||||||
|
- acr
|
||||||
|
exclude:
|
||||||
|
- image: ""
|
||||||
|
repo: gcr
|
||||||
|
- image: ""
|
||||||
|
repo: gar
|
||||||
|
- image: ""
|
||||||
|
repo: ecr
|
||||||
|
- image: ""
|
||||||
|
repo: acr
|
||||||
|
- image: "-gcr"
|
||||||
|
repo: docker
|
||||||
|
- image: "-gcr"
|
||||||
|
repo: gar
|
||||||
|
- image: "-gcr"
|
||||||
|
repo: ecr
|
||||||
|
- image: "-gcr"
|
||||||
|
repo: acr
|
||||||
|
- image: "-gar"
|
||||||
|
repo: docker
|
||||||
|
- image: "-gar"
|
||||||
|
repo: gcr
|
||||||
|
- image: "-gar"
|
||||||
|
repo: ecr
|
||||||
|
- image: "-gar"
|
||||||
|
repo: acr
|
||||||
|
- image: "-ecr"
|
||||||
|
repo: docker
|
||||||
|
- image: "-ecr"
|
||||||
|
repo: gcr
|
||||||
|
- image: "-ecr"
|
||||||
|
repo: gar
|
||||||
|
- image: "-ecr"
|
||||||
|
repo: acr
|
||||||
|
- image: "-acr"
|
||||||
|
repo: docker
|
||||||
|
- image: "-acr"
|
||||||
|
repo: gcr
|
||||||
|
- image: "-acr"
|
||||||
|
repo: gar
|
||||||
|
- image: "-acr"
|
||||||
|
repo: ecr
|
||||||
|
nodeName: _<+matrix.repo>
|
||||||
|
- step:
|
||||||
|
type: Plugin
|
||||||
|
name: BuildAndPushDockerTag_Kaniko
|
||||||
|
identifier: BuildAndPushDockerTag_Kaniko
|
||||||
|
spec:
|
||||||
|
connectorRef: Plugins_Docker_Hub_Connector
|
||||||
|
image: plugins/docker
|
||||||
|
settings:
|
||||||
|
username: drone
|
||||||
|
password: <+secrets.getValue("Plugins_Docker_Hub_Pat")>
|
||||||
|
repo: plugins/kaniko<+matrix.image>
|
||||||
|
dockerfile: docker/<+matrix.repo>/Dockerfile.linux.arm64.kaniko1.9.1
|
||||||
|
auto_tag: "true"
|
||||||
|
auto_tag_suffix: linux-arm64-kaniko1.9.1
|
||||||
|
daemon_off: "false"
|
||||||
|
when:
|
||||||
|
stageStatus: Success
|
||||||
|
condition: <+codebase.build.type> == "tag"
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
image:
|
||||||
|
- ""
|
||||||
|
- "-gcr"
|
||||||
|
- "-gar"
|
||||||
|
- "-ecr"
|
||||||
|
repo:
|
||||||
|
- docker
|
||||||
|
- gcr
|
||||||
|
- gar
|
||||||
|
- ecr
|
||||||
|
exclude:
|
||||||
|
- image: ""
|
||||||
|
repo: gcr
|
||||||
|
- image: ""
|
||||||
|
repo: gar
|
||||||
|
- image: ""
|
||||||
|
repo: ecr
|
||||||
|
- image: "-gcr"
|
||||||
|
repo: docker
|
||||||
|
- image: "-gcr"
|
||||||
|
repo: gar
|
||||||
|
- image: "-gcr"
|
||||||
|
repo: ecr
|
||||||
|
- image: "-gar"
|
||||||
|
repo: docker
|
||||||
|
- image: "-gar"
|
||||||
|
repo: gcr
|
||||||
|
- image: "-gar"
|
||||||
|
repo: ecr
|
||||||
|
- image: "-ecr"
|
||||||
|
repo: docker
|
||||||
|
- image: "-ecr"
|
||||||
|
repo: gcr
|
||||||
|
- image: "-ecr"
|
||||||
|
repo: gar
|
||||||
|
nodeName: _<+matrix.repo>
|
||||||
|
- parallel:
|
||||||
|
- step:
|
||||||
|
type: BuildAndPushDockerRegistry
|
||||||
|
name: BuildAndPushDockerBranch
|
||||||
|
identifier: BuildAndPushDockerBranch
|
||||||
|
spec:
|
||||||
|
connectorRef: Plugins_Docker_Hub_Connector
|
||||||
|
repo: plugins/kaniko<+matrix.image>
|
||||||
|
tags:
|
||||||
|
- linux-arm64
|
||||||
|
caching: false
|
||||||
|
dockerfile: docker/<+matrix.repo>/Dockerfile.linux.arm64
|
||||||
|
when:
|
||||||
|
stageStatus: Success
|
||||||
|
condition: <+codebase.build.type> == "branch"
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
image:
|
||||||
|
- ""
|
||||||
|
- "-gcr"
|
||||||
|
- "-gar"
|
||||||
|
- "-ecr"
|
||||||
|
- "-acr"
|
||||||
|
repo:
|
||||||
|
- docker
|
||||||
|
- gcr
|
||||||
|
- gar
|
||||||
|
- ecr
|
||||||
|
- acr
|
||||||
|
exclude:
|
||||||
|
- image: ""
|
||||||
|
repo: gcr
|
||||||
|
- image: ""
|
||||||
|
repo: gar
|
||||||
|
- image: ""
|
||||||
|
repo: ecr
|
||||||
|
- image: ""
|
||||||
|
repo: acr
|
||||||
|
- image: "-gcr"
|
||||||
|
repo: docker
|
||||||
|
- image: "-gcr"
|
||||||
|
repo: gar
|
||||||
|
- image: "-gcr"
|
||||||
|
repo: ecr
|
||||||
|
- image: "-gcr"
|
||||||
|
repo: acr
|
||||||
|
- image: "-gar"
|
||||||
|
repo: docker
|
||||||
|
- image: "-gar"
|
||||||
|
repo: gcr
|
||||||
|
- image: "-gar"
|
||||||
|
repo: ecr
|
||||||
|
- image: "-gar"
|
||||||
|
repo: acr
|
||||||
|
- image: "-ecr"
|
||||||
|
repo: docker
|
||||||
|
- image: "-ecr"
|
||||||
|
repo: gcr
|
||||||
|
- image: "-ecr"
|
||||||
|
repo: gar
|
||||||
|
- image: "-ecr"
|
||||||
|
repo: acr
|
||||||
|
- image: "-acr"
|
||||||
|
repo: docker
|
||||||
|
- image: "-acr"
|
||||||
|
repo: gcr
|
||||||
|
- image: "-acr"
|
||||||
|
repo: gar
|
||||||
|
- image: "-acr"
|
||||||
|
repo: ecr
|
||||||
|
nodeName: <+matrix.repo>
|
||||||
|
- step:
|
||||||
|
type: BuildAndPushDockerRegistry
|
||||||
|
name: BuildAndPushDockerBranch_Kaniko
|
||||||
|
identifier: BuildAndPushDockerBranch_Kaniko
|
||||||
|
spec:
|
||||||
|
connectorRef: Plugins_Docker_Hub_Connector
|
||||||
|
repo: plugins/kaniko<+matrix.image>
|
||||||
|
tags:
|
||||||
|
- linux-arm64-kaniko1.9.1
|
||||||
|
caching: false
|
||||||
|
dockerfile: docker/<+matrix.repo>/Dockerfile.linux.arm64.kaniko1.9.1
|
||||||
|
when:
|
||||||
|
stageStatus: Success
|
||||||
|
condition: <+codebase.build.type> == "branch"
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
image:
|
||||||
|
- ""
|
||||||
|
- "-gcr"
|
||||||
|
- "-gar"
|
||||||
|
- "-ecr"
|
||||||
|
repo:
|
||||||
|
- docker
|
||||||
|
- gcr
|
||||||
|
- gar
|
||||||
|
- ecr
|
||||||
|
exclude:
|
||||||
|
- image: ""
|
||||||
|
repo: gcr
|
||||||
|
- image: ""
|
||||||
|
repo: gar
|
||||||
|
- image: ""
|
||||||
|
repo: ecr
|
||||||
|
- image: "-gcr"
|
||||||
|
repo: docker
|
||||||
|
- image: "-gcr"
|
||||||
|
repo: gar
|
||||||
|
- image: "-gcr"
|
||||||
|
repo: ecr
|
||||||
|
- image: "-gar"
|
||||||
|
repo: docker
|
||||||
|
- image: "-gar"
|
||||||
|
repo: gcr
|
||||||
|
- image: "-gar"
|
||||||
|
repo: ecr
|
||||||
|
- image: "-ecr"
|
||||||
|
repo: docker
|
||||||
|
- image: "-ecr"
|
||||||
|
repo: gcr
|
||||||
|
- image: "-ecr"
|
||||||
|
repo: gar
|
||||||
|
nodeName: _<+matrix.repo>
|
||||||
|
when:
|
||||||
|
pipelineStatus: Success
|
||||||
|
- stage:
|
||||||
|
name: Manifest
|
||||||
|
identifier: Manifest
|
||||||
|
description: ""
|
||||||
|
type: CI
|
||||||
|
spec:
|
||||||
|
cloneCodebase: true
|
||||||
|
caching:
|
||||||
|
enabled: false
|
||||||
|
paths: []
|
||||||
|
platform:
|
||||||
|
os: Linux
|
||||||
|
arch: Amd64
|
||||||
|
runtime:
|
||||||
|
type: Cloud
|
||||||
|
spec: {}
|
||||||
|
execution:
|
||||||
|
steps:
|
||||||
|
- parallel:
|
||||||
|
- step:
|
||||||
|
type: Plugin
|
||||||
|
name: Manifest
|
||||||
|
identifier: Manifest
|
||||||
|
spec:
|
||||||
|
connectorRef: Plugins_Docker_Hub_Connector
|
||||||
|
image: plugins/manifest
|
||||||
|
settings:
|
||||||
|
auto_tag: "true"
|
||||||
|
spec: docker/<+matrix.repo>/manifest.tmpl
|
||||||
|
username: drone
|
||||||
|
password: <+secrets.getValue("Plugins_Docker_Hub_Pat")>
|
||||||
|
ignore_missing: "true"
|
||||||
|
when:
|
||||||
|
stageStatus: Success
|
||||||
|
condition: <+codebase.build.type> == "branch" || <+codebase.build.type> == "tag"
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
repo:
|
||||||
|
- docker
|
||||||
|
- gcr
|
||||||
|
- gar
|
||||||
|
- ecr
|
||||||
|
- acr
|
||||||
|
nodeName: manifest_<+matrix.repo>
|
||||||
|
- step:
|
||||||
|
type: Plugin
|
||||||
|
name: Manifest_kaniko
|
||||||
|
identifier: Manifest_kaniko
|
||||||
|
spec:
|
||||||
|
connectorRef: Plugins_Docker_Hub_Connector
|
||||||
|
image: plugins/manifest
|
||||||
|
settings:
|
||||||
|
auto_tag: "true"
|
||||||
|
spec: docker/<+matrix.repo>/manifest-kaniko1.9.1.tmpl
|
||||||
|
username: drone
|
||||||
|
password: <+secrets.getValue("Plugins_Docker_Hub_Pat")>
|
||||||
|
ignore_missing: "true"
|
||||||
|
when:
|
||||||
|
stageStatus: Success
|
||||||
|
condition: <+codebase.build.type> == "branch" || <+codebase.build.type> == "tag"
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
repo:
|
||||||
|
- docker
|
||||||
|
- gcr
|
||||||
|
- gar
|
||||||
|
- ecr
|
||||||
|
nodeName: manifest_<+matrix.repo>
|
||||||
|
when:
|
||||||
|
pipelineStatus: Success
|
||||||
+12
-4
@@ -451,6 +451,7 @@ func run(c *cli.Context) error {
|
|||||||
SkipTLSVerifyRegistry: c.Bool("skip-tls-verify-registry"),
|
SkipTLSVerifyRegistry: c.Bool("skip-tls-verify-registry"),
|
||||||
UseNewRun: c.Bool("use-new-run"),
|
UseNewRun: c.Bool("use-new-run"),
|
||||||
IgnorePath: c.String("ignore-path"),
|
IgnorePath: c.String("ignore-path"),
|
||||||
|
IgnorePaths: c.StringSlice("ignore-paths"),
|
||||||
ImageFSExtractRetry: c.Int("image-fs-extract-retry"),
|
ImageFSExtractRetry: c.Int("image-fs-extract-retry"),
|
||||||
ImageDownloadRetry: c.Int("image-download-retry"),
|
ImageDownloadRetry: c.Int("image-download-retry"),
|
||||||
},
|
},
|
||||||
@@ -479,25 +480,32 @@ func setupAuth(tenantId, clientId, cert,
|
|||||||
return "", fmt.Errorf("registry must be specified")
|
return "", fmt.Errorf("registry must be specified")
|
||||||
}
|
}
|
||||||
|
|
||||||
if noPush {
|
|
||||||
return "", nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// case of client secret or cert based auth
|
// case of client secret or cert based auth
|
||||||
if clientId != "" {
|
if clientId != "" {
|
||||||
// only setup auth when pushing or credentials are defined
|
// only setup auth when pushing or credentials are defined
|
||||||
|
|
||||||
token, publicUrl, err := getACRToken(subscriptionId, tenantId, clientId, clientSecret, cert, registry)
|
token, publicUrl, err := getACRToken(subscriptionId, tenantId, clientId, clientSecret, cert, registry)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if noPush {
|
||||||
|
logrus.Warnf("NO_PUSH mode: failed to fetch ACR Token: %v", err)
|
||||||
|
return "", nil
|
||||||
|
}
|
||||||
return "", errors.Wrap(err, "failed to fetch ACR Token")
|
return "", errors.Wrap(err, "failed to fetch ACR Token")
|
||||||
}
|
}
|
||||||
|
|
||||||
// setup docker config for azure registry and base image docker registry
|
// setup docker config for azure registry and base image docker registry
|
||||||
if err := setDockerAuth(username, token, registry, dockerUsername, dockerPassword, dockerRegistry); err != nil {
|
if err := setDockerAuth(username, token, registry, dockerUsername, dockerPassword, dockerRegistry); err != nil {
|
||||||
|
if noPush {
|
||||||
|
logrus.Warnf("NO_PUSH mode: failed to create docker config: %v", err)
|
||||||
|
return "", nil
|
||||||
|
}
|
||||||
return "", errors.Wrap(err, "failed to create docker config")
|
return "", errors.Wrap(err, "failed to create docker config")
|
||||||
}
|
}
|
||||||
return publicUrl, nil
|
return publicUrl, nil
|
||||||
} else {
|
} else {
|
||||||
|
if noPush {
|
||||||
|
return "", nil
|
||||||
|
}
|
||||||
return "", fmt.Errorf("managed authentication is not supported")
|
return "", fmt.Errorf("managed authentication is not supported")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -353,6 +353,11 @@ func main() {
|
|||||||
Usage: "Path to ignore during the build.",
|
Usage: "Path to ignore during the build.",
|
||||||
EnvVar: "PLUGIN_IGNORE_PATH",
|
EnvVar: "PLUGIN_IGNORE_PATH",
|
||||||
},
|
},
|
||||||
|
cli.StringSliceFlag{
|
||||||
|
Name: "ignore-paths",
|
||||||
|
Usage: "Path to ignore during the build.",
|
||||||
|
EnvVar: "PLUGIN_IGNORE_PATHS",
|
||||||
|
},
|
||||||
cli.IntFlag{
|
cli.IntFlag{
|
||||||
Name: "image-fs-extract-retry",
|
Name: "image-fs-extract-retry",
|
||||||
Usage: "Number of retries for extracting filesystem layers.",
|
Usage: "Number of retries for extracting filesystem layers.",
|
||||||
@@ -460,6 +465,7 @@ func run(c *cli.Context) error {
|
|||||||
SourceTarPath: c.String("source-tar-path"),
|
SourceTarPath: c.String("source-tar-path"),
|
||||||
UseNewRun: c.Bool("use-new-run"),
|
UseNewRun: c.Bool("use-new-run"),
|
||||||
IgnorePath: c.String("ignore-path"),
|
IgnorePath: c.String("ignore-path"),
|
||||||
|
IgnorePaths: c.StringSlice("ignore-paths"),
|
||||||
|
|
||||||
ImageFSExtractRetry: c.Int("image-fs-extract-retry"),
|
ImageFSExtractRetry: c.Int("image-fs-extract-retry"),
|
||||||
ImageDownloadRetry: c.Int("image-download-retry"),
|
ImageDownloadRetry: c.Int("image-download-retry"),
|
||||||
|
|||||||
@@ -518,6 +518,7 @@ func run(c *cli.Context) error {
|
|||||||
SkipTLSVerifyRegistry: c.Bool("skip-tls-verify-registry"),
|
SkipTLSVerifyRegistry: c.Bool("skip-tls-verify-registry"),
|
||||||
UseNewRun: c.Bool("use-new-run"),
|
UseNewRun: c.Bool("use-new-run"),
|
||||||
IgnorePath: c.String("ignore-path"),
|
IgnorePath: c.String("ignore-path"),
|
||||||
|
IgnorePaths: c.StringSlice("ignore-paths"),
|
||||||
ImageFSExtractRetry: c.Int("image-fs-extract-retry"),
|
ImageFSExtractRetry: c.Int("image-fs-extract-retry"),
|
||||||
ImageDownloadRetry: c.Int("image-download-retry"),
|
ImageDownloadRetry: c.Int("image-download-retry"),
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -414,6 +414,7 @@ func run(c *cli.Context) error {
|
|||||||
SkipTLSVerifyRegistry: c.Bool("skip-tls-verify-registry"),
|
SkipTLSVerifyRegistry: c.Bool("skip-tls-verify-registry"),
|
||||||
UseNewRun: c.Bool("use-new-run"),
|
UseNewRun: c.Bool("use-new-run"),
|
||||||
IgnorePath: c.String("ignore-path"),
|
IgnorePath: c.String("ignore-path"),
|
||||||
|
IgnorePaths: c.StringSlice("ignore-paths"),
|
||||||
ImageFSExtractRetry: c.Int("image-fs-extract-retry"),
|
ImageFSExtractRetry: c.Int("image-fs-extract-retry"),
|
||||||
ImageDownloadRetry: c.Int("image-download-retry"),
|
ImageDownloadRetry: c.Int("image-download-retry"),
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -416,6 +416,7 @@ func run(c *cli.Context) error {
|
|||||||
SkipTLSVerifyRegistry: c.Bool("skip-tls-verify-registry"),
|
SkipTLSVerifyRegistry: c.Bool("skip-tls-verify-registry"),
|
||||||
UseNewRun: c.Bool("use-new-run"),
|
UseNewRun: c.Bool("use-new-run"),
|
||||||
IgnorePath: c.String("ignore-path"),
|
IgnorePath: c.String("ignore-path"),
|
||||||
|
IgnorePaths: c.StringSlice("ignore-paths"),
|
||||||
ImageFSExtractRetry: c.Int("image-fs-extract-retry"),
|
ImageFSExtractRetry: c.Int("image-fs-extract-retry"),
|
||||||
ImageDownloadRetry: c.Int("image-download-retry"),
|
ImageDownloadRetry: c.Int("image-download-retry"),
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -49,41 +49,42 @@ type (
|
|||||||
Target string // Docker build target
|
Target string // Docker build target
|
||||||
Verbosity string // Log level
|
Verbosity string // Log level
|
||||||
|
|
||||||
Cache bool // Enable or disable caching during the build process.
|
Cache bool // Enable or disable caching during the build process.
|
||||||
CacheDir string // Directory to store cached layers.
|
CacheDir string // Directory to store cached layers.
|
||||||
CacheCopyLayers bool // Enable or disable copying layers from the cache.
|
CacheCopyLayers bool // Enable or disable copying layers from the cache.
|
||||||
CacheRunLayers bool // Enable or disable running layers from the cache.
|
CacheRunLayers bool // Enable or disable running layers from the cache.
|
||||||
Cleanup bool // Enable or disable cleanup of temporary files.
|
Cleanup bool // Enable or disable cleanup of temporary files.
|
||||||
CompressedCaching *bool // Enable or disable compressed caching.
|
CompressedCaching *bool // Enable or disable compressed caching.
|
||||||
ContextSubPath string // Sub-path within the context to build.
|
ContextSubPath string // Sub-path within the context to build.
|
||||||
CustomPlatform string // Platform to use for building.
|
CustomPlatform string // Platform to use for building.
|
||||||
Force bool // Force building the image even if it already exists.
|
Force bool // Force building the image even if it already exists.
|
||||||
Git bool // Branch to clone if build context is a git repository .
|
Git bool // Branch to clone if build context is a git repository .
|
||||||
ImageNameWithDigestFile string // Write image name with digest to a file.
|
ImageNameWithDigestFile string // Write image name with digest to a file.
|
||||||
ImageNameTagWithDigestFile string // Write image name with tag and digest to a file.
|
ImageNameTagWithDigestFile string // Write image name with tag and digest to a file.
|
||||||
Insecure bool // Allow connecting to registries without TLS.
|
Insecure bool // Allow connecting to registries without TLS.
|
||||||
InsecurePull bool // Allow insecure pulls from the registry.
|
InsecurePull bool // Allow insecure pulls from the registry.
|
||||||
InsecureRegistry string // Use plain HTTP for registry communication.
|
InsecureRegistry string // Use plain HTTP for registry communication.
|
||||||
Label string // Add metadata to an image.
|
Label string // Add metadata to an image.
|
||||||
LogFormat string // Set the log format for build output.
|
LogFormat string // Set the log format for build output.
|
||||||
LogTimestamp bool // Show timestamps in build output.
|
LogTimestamp bool // Show timestamps in build output.
|
||||||
OCILayoutPath string // Directory to store OCI layout.
|
OCILayoutPath string // Directory to store OCI layout.
|
||||||
PushRetry int // Number of times to retry pushing an image.
|
PushRetry int // Number of times to retry pushing an image.
|
||||||
RegistryCertificate string // Path to a file containing a registry certificate.
|
RegistryCertificate string // Path to a file containing a registry certificate.
|
||||||
RegistryClientCert string // Path to a file containing a registry client certificate.
|
RegistryClientCert string // Path to a file containing a registry client certificate.
|
||||||
RegistryMirror string // Mirror for registry pulls.
|
RegistryMirror string // Mirror for registry pulls.
|
||||||
SkipDefaultRegistryFallback bool // Skip Docker Hub and default registry fallback.
|
SkipDefaultRegistryFallback bool // Skip Docker Hub and default registry fallback.
|
||||||
Reproducible bool // Create a reproducible image.
|
Reproducible bool // Create a reproducible image.
|
||||||
SingleSnapshot bool // Only create a single snapshot of the image.
|
SingleSnapshot bool // Only create a single snapshot of the image.
|
||||||
SkipTLSVerify bool // Skip TLS verification when connecting to the registry.
|
SkipTLSVerify bool // Skip TLS verification when connecting to the registry.
|
||||||
SkipPushPermissionCheck bool // Skip permission check when pushing.
|
SkipPushPermissionCheck bool // Skip permission check when pushing.
|
||||||
SkipTLSVerifyPull bool // Skip TLS verification when pulling.
|
SkipTLSVerifyPull bool // Skip TLS verification when pulling.
|
||||||
SkipTLSVerifyRegistry bool // Skip TLS verification when connecting to a registry.
|
SkipTLSVerifyRegistry bool // Skip TLS verification when connecting to a registry.
|
||||||
UseNewRun bool // Use the new container runtime (`runc`) for builds.
|
UseNewRun bool // Use the new container runtime (`runc`) for builds.
|
||||||
IgnoreVarRun *bool // Ignore `/var/run` when copying from the context.
|
IgnoreVarRun *bool // Ignore `/var/run` when copying from the context.
|
||||||
IgnorePath string // Ignore files matching the specified path pattern.
|
IgnorePath string // Ignore files matching the specified path pattern.
|
||||||
ImageFSExtractRetry int // Number of times to retry extracting the image filesystem.
|
IgnorePaths []string // Ignore files matching the specified path pattern.
|
||||||
ImageDownloadRetry int // Number of times to retry downloading layers.
|
ImageFSExtractRetry int // Number of times to retry extracting the image filesystem.
|
||||||
|
ImageDownloadRetry int // Number of times to retry downloading layers.
|
||||||
}
|
}
|
||||||
|
|
||||||
// Artifact defines content of artifact file
|
// Artifact defines content of artifact file
|
||||||
@@ -448,6 +449,15 @@ func (p Plugin) Exec() error {
|
|||||||
cmdArgs = append(cmdArgs, fmt.Sprintf("--ignore-path=%s", p.Build.IgnorePath))
|
cmdArgs = append(cmdArgs, fmt.Sprintf("--ignore-path=%s", p.Build.IgnorePath))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if p.Build.IgnorePaths != nil {
|
||||||
|
for _, path := range p.Build.IgnorePaths {
|
||||||
|
trimmed := strings.TrimSpace(path)
|
||||||
|
if trimmed != "" {
|
||||||
|
cmdArgs = append(cmdArgs, fmt.Sprintf("--ignore-path=%s", trimmed))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if p.Build.ImageFSExtractRetry != 0 {
|
if p.Build.ImageFSExtractRetry != 0 {
|
||||||
cmdArgs = append(cmdArgs, fmt.Sprintf("--image-fs-extract-retry=%d", p.Build.ImageFSExtractRetry))
|
cmdArgs = append(cmdArgs, fmt.Sprintf("--image-fs-extract-retry=%d", p.Build.ImageFSExtractRetry))
|
||||||
}
|
}
|
||||||
@@ -473,14 +483,13 @@ func (p Plugin) Exec() error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if p.Output.OutputFile != "" {
|
p.Output.OutputFile = os.Getenv("DRONE_OUTPUT")
|
||||||
var tarPath string
|
var tarPath string
|
||||||
if p.Build.TarPath != "" {
|
if p.Build.TarPath != "" {
|
||||||
tarPath = getTarPath(p.Build.TarPath)
|
tarPath = getTarPath(p.Build.TarPath)
|
||||||
}
|
}
|
||||||
if err = output.WritePluginOutputFile(p.Output.OutputFile, getDigest(p.Build.DigestFile), tarPath); err != nil {
|
if err = output.WritePluginOutputFile(p.Output.OutputFile, getDigest(p.Build.DigestFile), tarPath); err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "failed to write plugin output file at path: %s with error: %s\n", p.Output.OutputFile, err)
|
fmt.Fprintf(os.Stderr, "failed to write plugin output file at path: %s with error: %s\n", p.Output.OutputFile, err)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
Reference in New Issue
Block a user