Skip to content

Commit

Permalink
fix: log during syft step
Browse files Browse the repository at this point in the history
I found that the syft step may take a non-negligble amount of time in my
builds. Currently, it emits nothing to stdout, so it can feel like your
build is stuck doing nothing.

By printing here, the user will get a clue as to what is happening.

Signed-off-by: Ralph Bean <[email protected]>
  • Loading branch information
ralphbean committed May 15, 2024
1 parent 833463f commit dab9143
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions task/buildah-remote/0.1/buildah-remote.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -364,8 +364,10 @@ spec:
image: quay.io/redhat-appstudio/syft:v0.105.1@sha256:1910b829997650c696881e5fc2fc654ddf3184c27edb1b2024e9cb2ba51ac431
name: sbom-syft-generate
script: |
echo "Running syft on the source directory"
syft dir:$(workspaces.source.path)/source --output cyclonedx-json=$(workspaces.source.path)/sbom-source.json
find $(cat /workspace/container_path) -xtype l -delete
echo "Running syft on the image filesystem"
syft dir:$(cat /workspace/container_path) --output cyclonedx-json=$(workspaces.source.path)/sbom-image.json
volumeMounts:
- mountPath: /var/lib/containers
Expand Down
2 changes: 2 additions & 0 deletions task/buildah/0.1/buildah.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,10 @@ spec:
# (need to set the workdir, see https://github.com/anchore/syft/issues/2465)
workingDir: $(workspaces.source.path)/source
script: |
echo "Running syft on the source directory"
syft dir:$(workspaces.source.path)/source --output cyclonedx-json=$(workspaces.source.path)/sbom-source.json
find $(cat /workspace/container_path) -xtype l -delete
echo "Running syft on the image filesystem"
syft dir:$(cat /workspace/container_path) --output cyclonedx-json=$(workspaces.source.path)/sbom-image.json
volumeMounts:
- mountPath: /var/lib/containers
Expand Down

0 comments on commit dab9143

Please sign in to comment.