Skip to content

Commit

Permalink
new build-args-file parameter which allows to pass build arguments to
Browse files Browse the repository at this point in the history
buildah task

KONFLUX-268

Signed-off-by: Robert Cerven <[email protected]>
  • Loading branch information
rcerven committed Apr 11, 2024
1 parent d4b49e5 commit b5d96e2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pipelines/template-build/template-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ spec:
description: Build a source image.
type: string
default: "false"
- name: build-args-file
description: Path to a file with build arguments which will be passed to podman during build
type: string
default: ""
tasks:
- name: init
params:
Expand Down Expand Up @@ -106,6 +110,9 @@ spec:
- input: $(tasks.init.results.build)
operator: in
values: ["true"]
params:
- name: BUILD_ARGS_FILE
value: "$(params.build-args-file)"
runAfter:
- prefetch-dependencies
taskRef:
Expand Down
12 changes: 12 additions & 0 deletions task/buildah/0.1/buildah.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ spec:
description: Name of secret which contains the entitlement certificates
type: string
default: "etc-pki-entitlement"
- name: BUILD_ARGS_FILE
description: Path to a file with build arguments which will be passed to podman during build
type: string
default: ""

results:
- description: Digest of the image just built
name: IMAGE_DIGEST
Expand Down Expand Up @@ -115,6 +120,9 @@ spec:
value: $(params.BUILDER_IMAGE)
- name: ENTITLEMENT_SECRET
value: $(params.ENTITLEMENT_SECRET)
- name: BUILD_ARGS_FILE
value: $(params.BUILD_ARGS_FILE)

steps:
- image: quay.io/redhat-appstudio/buildah:v1.31.0@sha256:34f12c7b72ec2c28f1ded0c494b428df4791c909f1f174dd21b8ed6a57cf5ddb
name: build
Expand Down Expand Up @@ -185,6 +193,10 @@ spec:
BUILDAH_ARGS+=("--target=${TARGET_STAGE}")
fi
if [ -n "${BUILD_ARGS_FILE}" ]; then
BUILDAH_ARGS+=("--build-arg-file=${BUILD_ARGS_FILE}")
fi
if [ -n "${PREFETCH_INPUT}" ]; then
cp -r cachi2 /tmp/
chmod -R go+rwX /tmp/cachi2
Expand Down

0 comments on commit b5d96e2

Please sign in to comment.