Add support for dockerfile targets to workflows.
Some checks failed
semver Build semver has succeeded
format Build format has succeeded
rust-test Build rust-test has succeeded
build Build build has succeeded
clippy Build clippy has failed

This commit is contained in:
Tom Alexander 2024-09-29 23:23:22 -04:00
parent f07c0dc971
commit 3c58d19a88
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
4 changed files with 27 additions and 3 deletions

View File

@ -14,6 +14,9 @@ spec:
- name: image-name - name: image-name
description: The name for the built image description: The name for the built image
type: string type: string
- name: target-name
description: The dockerfile target to build
type: string
- name: path-to-image-context - name: path-to-image-context
description: The path to the build context description: The path to the build context
type: string type: string
@ -122,6 +125,7 @@ spec:
- name: EXTRA_ARGS - name: EXTRA_ARGS
value: value:
- "--destination=$(params.image-name)" # Also write the :latest image - "--destination=$(params.image-name)" # Also write the :latest image
- "--target=$(params.target-name)"
- --cache=true - --cache=true
- --cache-copy-layers - --cache-copy-layers
- --cache-repo=harbor.fizz.buzz/kanikocache/cache - --cache-repo=harbor.fizz.buzz/kanikocache/cache
@ -216,6 +220,8 @@ spec:
params: params:
- name: image-name - name: image-name
value: "harbor.fizz.buzz/private/webhook-bridge" value: "harbor.fizz.buzz/private/webhook-bridge"
- name: target-name
value: ""
- name: path-to-image-context - name: path-to-image-context
value: . value: .
- name: path-to-dockerfile - name: path-to-dockerfile

View File

@ -14,6 +14,9 @@ spec:
- name: image-name - name: image-name
description: The name for the built image description: The name for the built image
type: string type: string
- name: target-name
description: The dockerfile target to build
type: string
- name: path-to-image-context - name: path-to-image-context
description: The path to the build context description: The path to the build context
type: string type: string
@ -89,6 +92,7 @@ spec:
value: "gcr.io/kaniko-project/executor:v1.12.1" value: "gcr.io/kaniko-project/executor:v1.12.1"
- name: EXTRA_ARGS - name: EXTRA_ARGS
value: value:
- "--target=$(params.target-name)"
- --cache=true - --cache=true
- --cache-copy-layers - --cache-copy-layers
- --cache-repo=harbor.fizz.buzz/kanikocache/cache - --cache-repo=harbor.fizz.buzz/kanikocache/cache
@ -292,7 +296,9 @@ spec:
secretName: harbor-plain secretName: harbor-plain
params: params:
- name: image-name - name: image-name
value: "harbor.fizz.buzz/private/webhook-bridge-development" value: "harbor.fizz.buzz/private/webhook-bridge-development-format"
- name: target-name
value: ""
- name: path-to-image-context - name: path-to-image-context
value: docker/webhook_bridge_development/ value: docker/webhook_bridge_development/
- name: path-to-dockerfile - name: path-to-dockerfile

View File

@ -14,6 +14,9 @@ spec:
- name: image-name - name: image-name
description: The name for the built image description: The name for the built image
type: string type: string
- name: target-name
description: The dockerfile target to build
type: string
- name: path-to-image-context - name: path-to-image-context
description: The path to the build context description: The path to the build context
type: string type: string
@ -89,6 +92,7 @@ spec:
value: "gcr.io/kaniko-project/executor:v1.12.1" value: "gcr.io/kaniko-project/executor:v1.12.1"
- name: EXTRA_ARGS - name: EXTRA_ARGS
value: value:
- "--target=$(params.target-name)"
- --cache=true - --cache=true
- --cache-copy-layers - --cache-copy-layers
- --cache-repo=harbor.fizz.buzz/kanikocache/cache - --cache-repo=harbor.fizz.buzz/kanikocache/cache
@ -271,7 +275,9 @@ spec:
secretName: harbor-plain secretName: harbor-plain
params: params:
- name: image-name - name: image-name
value: "harbor.fizz.buzz/private/webhook-bridge-development" value: "harbor.fizz.buzz/private/webhook-bridge-development-clippy"
- name: target-name
value: ""
- name: path-to-image-context - name: path-to-image-context
value: docker/webhook_bridge_development/ value: docker/webhook_bridge_development/
- name: path-to-dockerfile - name: path-to-dockerfile

View File

@ -14,6 +14,9 @@ spec:
- name: image-name - name: image-name
description: The name for the built image description: The name for the built image
type: string type: string
- name: target-name
description: The dockerfile target to build
type: string
- name: path-to-image-context - name: path-to-image-context
description: The path to the build context description: The path to the build context
type: string type: string
@ -89,6 +92,7 @@ spec:
value: "gcr.io/kaniko-project/executor:v1.12.1" value: "gcr.io/kaniko-project/executor:v1.12.1"
- name: EXTRA_ARGS - name: EXTRA_ARGS
value: value:
- "--target=$(params.target-name)"
- --cache=true - --cache=true
- --cache-copy-layers - --cache-copy-layers
- --cache-repo=harbor.fizz.buzz/kanikocache/cache - --cache-repo=harbor.fizz.buzz/kanikocache/cache
@ -261,7 +265,9 @@ spec:
secretName: harbor-plain secretName: harbor-plain
params: params:
- name: image-name - name: image-name
value: "harbor.fizz.buzz/private/webhook-bridge-development" value: "harbor.fizz.buzz/private/webhook-bridge-development-test"
- name: target-name
value: ""
- name: path-to-image-context - name: path-to-image-context
value: docker/webhook_bridge_development/ value: docker/webhook_bridge_development/
- name: path-to-dockerfile - name: path-to-dockerfile