Skip to content

Commit

Permalink
buildah-sast: migrate to the new buildah interface
Browse files Browse the repository at this point in the history
  • Loading branch information
kdudka committed Oct 25, 2024
1 parent 5dc857c commit 8e03ea8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
17 changes: 11 additions & 6 deletions task/buildah-sast/0.2/patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@
- op: add
path: /spec/steps/0/env/-
value:
name: VOLUME_MOUNTS_FROM_ENV
value: >-
--volume /tmp/sast-scan-results:/sast-scan-results
name: ADDITIONAL_VOLUME_MOUNTS
value: |-
/tmp/sast-scan-results:/sast-scan-results
# Add prepare and postprocess steps
# Prepare step
Expand All @@ -75,6 +75,9 @@
memory: 0.5Gi
cpu: '0.5'
workingDir: $(workspaces.source.path)
env:
- name: DOCKERFILE
value: $(params.DOCKERFILE)
script: |
# Dockerfile discovery logic is copied from buildah task
SOURCE_CODE_DIR=source
Expand All @@ -101,10 +104,12 @@
fi
# Modify Dockerfile
sed -i '1 i\ARG NEW_ARG=default-value' $dockerfile_path
sed '1 i\ARG NEW_ARG=default-value' $dockerfile_path | tee /shared/Containerfile
echo 'Modified Dockerfile:'
cat $dockerfile_path
# Make the buildah task use the instrumented Dockerfile
- op: replace
path: /spec/steps/1/env/1/value # steps -> build -> env -> DOCKERFILE
value: /shared/Containerfile

# Postprocess step
- op: add
Expand Down
5 changes: 5 additions & 0 deletions task/buildah-sast/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# See the OWNERS docs: https://go.k8s.io/owners
approvers:
- build-team
reviewers:
- build-team

0 comments on commit 8e03ea8

Please sign in to comment.