-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
buildah*: add BUILD_ARGS param #1023
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we expose this parameter in the pipeline definitions that we produce?
1f1a227
to
4f8eccd
Compare
Tested in my acmiel-tenant namespace with oc create -f test-pipelinerun.yaml test-pipelinerun.yaml (click me)apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
generateName: acmiel-test-
spec:
pipelineSpec:
tasks:
- name: build-container
params:
- name: IMAGE
value: quay.io/redhat-user-workloads/acmiel-tenant/build-service/build-service:test_buildah_build_args
- name: DOCKERFILE
value: https://gist.githubusercontent.com/chmeliik/920ee8dc43fd16927996f9f7c597fa56/raw/503729b236fd7ad1a2a97c5118e26016b46cd8af/Containerfile
- name: CONTEXT
value: .
- name: BUILD_ARGS
value:
- "THIS_IS_A_LABEL_WITH_SOME_NEWLINES=Hello there!\nGeneral Kenobi."
- |
THIS_IS_A_WHOLE_PYTHON_SCRIPT=
import this
print()
print("This was the Zen of Python, brought to you by a silly container build.")
- |
AND_THIS_IS_not_SHELL_INJECTION=
for i in $(seq 1 10); do
echo "Trying to come up with something funny, attempt $i"
done
echo "Failed"
taskRef:
params:
- name: url
value: https://github.com/chmeliik/build-definitions.git
- name: revision
value: build-args-param
- name: pathInRepo
value: task/buildah/0.1/buildah.yaml
resolver: git
workspaces:
- name: source
workspace: workspace
workspaces:
- name: workspace
workspaces:
- name: workspace
volumeClaimTemplate:
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi Relevant part of the logs (see that the build args got to the buildah build unscathed)
Also $ skopeo inspect --config docker://quay.io/redhat-user-workloads/acmiel-tenant/build-service/build-service:test_buildah_build_args | jq .config.Labels
{
"acmiel.test/foo": "Hello there!\nGeneral Kenobi.",
"architecture": "x86_64",
"build-date": "2024-05-17T10:43:45",
"io.buildah.version": "1.31.0",
"vcs-type": "git"
} |
4f8eccd
to
616919c
Compare
Added 👍 Also required fixing the generate-pipelines-readme script to handle arrays |
616919c
to
fa4944f
Compare
fa4944f
to
21ff65e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
STONEBLD-2462 Add a BUILD_ARGS array parameter to allow users to pass build args directly, not just via BUILD_ARGS_FILE. This provides greater flexibility. Those who just need static build args can commit a file into their repo and use BUILD_ARGS_FILE. Those who need dynamic values can create a custom task and incorporate its return value into the BUILD_ARGS array. Also: - quote a few unquoted array expansions which will otherwise break in hilarious ways - improve the description of the BUILD_ARGS_FILE param Signed-off-by: Adam Cmiel <[email protected]>
Previously, given an array param with a default value, the script would fail with Error: !!seq cannot be added to a !!str Convert array params to string (the JSON representation of the array). Also break up the huge line into multiple lines. Signed-off-by: Adam Cmiel <[email protected]>
If you're wondering why the READMEs were not regenerated for buildah-remote and buildah-rhtap: - buildah-remote has a manually modified README - buildah-rhtap doesn't have one Signed-off-by: Adam Cmiel <[email protected]>
STONEBLD-2462 Exposes the BUILD_ARGS param of the buildah task. Also improve the description of the build-args-file param. Signed-off-by: Adam Cmiel <[email protected]>
Also: - fix wrong escape sequences in regex strings - slightly improve param matching (previously, the script would only match param uses where the param is not part of a larger string) Signed-off-by: Adam Cmiel <[email protected]>
Signed-off-by: Adam Cmiel <[email protected]>
21ff65e
to
0c0a77d
Compare
Quality Gate passedIssues Measures |
/retest missed the failure |
/retest |
We had too many Secrets linked to the CI should have a better chance of working now. |
/retest |
STONEBLD-2462
Add a BUILD_ARGS array parameter to allow users to pass build args
directly, not just via BUILD_ARGS_FILE.
This provides greater flexibility. Those who just need static build args
can commit a file into their repo and use BUILD_ARGS_FILE. Those who
need dynamic values can create a custom task and incorporate its return
value into the BUILD_ARGS array.
Also: