Skip to content
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

Fix non-hermetic OCI TA builds #1043

Merged
merged 1 commit into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions task/buildah-oci-ta/0.1/buildah-oci-ta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ spec:
BUILDAH_ARGS+=("--build-arg=$build_arg")
done

if [ -d "/var/workdir/cachi2" ]; then
if [ -f "/var/workdir/cachi2/cachi2.env" ]; then
cp -r "/var/workdir/cachi2" /tmp/
chmod -R go+rwX /tmp/cachi2
VOLUME_MOUNTS="--volume /tmp/cachi2:/cachi2"
Expand Down Expand Up @@ -267,7 +267,7 @@ spec:
echo $container > /var/workdir/container_name

# Save the SBOM produced by Cachi2 so it can be merged into the final SBOM later
if [ -d "/var/workdir/cachi2" ]; then
if [ -f "/tmp/cachi2/output/bom.json" ]; then
cp /tmp/cachi2/output/bom.json ./sbom-cachi2.json
fi

Expand Down Expand Up @@ -359,7 +359,7 @@ spec:
- name: merge-cachi2-sbom
image: quay.io/redhat-appstudio/cachi2:0.7.0@sha256:1fc772aa3636fd0b43d62120d832e5913843e028e8cac42814b487c3a0a32bd8
script: |
if [ -d "/var/workdir/cachi2" ]; then
if [ -f "/var/workdir/sbom-cachi2.json" ]; then
echo "Merging contents of sbom-cachi2.json into sbom-cyclonedx.json"
/src/utils/merge_syft_sbom.py sbom-cachi2.json sbom-cyclonedx.json > sbom-temp.json
mv sbom-temp.json sbom-cyclonedx.json
Expand Down
6 changes: 3 additions & 3 deletions task/buildah-remote/0.1/buildah-remote.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ spec:
BUILDAH_ARGS+=("--build-arg=$build_arg")
done

if [ -d "$(workspaces.source.path)/cachi2" ]; then
if [ -f "$(workspaces.source.path)/cachi2/cachi2.env" ]; then
cp -r "$(workspaces.source.path)/cachi2" /tmp/
chmod -R go+rwX /tmp/cachi2
VOLUME_MOUNTS="--volume /tmp/cachi2:/cachi2"
Expand Down Expand Up @@ -308,7 +308,7 @@ spec:
echo $container > /workspace/container_name

# Save the SBOM produced by Cachi2 so it can be merged into the final SBOM later
if [ -d "$(workspaces.source.path)/cachi2" ]; then
if [ -f "/tmp/cachi2/output/bom.json" ]; then
cp /tmp/cachi2/output/bom.json ./sbom-cachi2.json
fi

Expand Down Expand Up @@ -436,7 +436,7 @@ spec:
image: quay.io/redhat-appstudio/cachi2:0.7.0@sha256:1fc772aa3636fd0b43d62120d832e5913843e028e8cac42814b487c3a0a32bd8
name: merge-cachi2-sbom
script: |
if [ -d "$(workspaces.source.path)/cachi2" ]; then
if [ -f "sbom-cachi2.json" ]; then
echo "Merging contents of sbom-cachi2.json into sbom-cyclonedx.json"
/src/utils/merge_syft_sbom.py sbom-cachi2.json sbom-cyclonedx.json > sbom-temp.json
mv sbom-temp.json sbom-cyclonedx.json
Expand Down
6 changes: 3 additions & 3 deletions task/buildah/0.1/buildah.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ spec:
BUILDAH_ARGS+=("--build-arg=$build_arg")
done

if [ -d "$(workspaces.source.path)/cachi2" ]; then
if [ -f "$(workspaces.source.path)/cachi2/cachi2.env" ]; then
cp -r "$(workspaces.source.path)/cachi2" /tmp/
chmod -R go+rwX /tmp/cachi2
VOLUME_MOUNTS="--volume /tmp/cachi2:/cachi2"
Expand Down Expand Up @@ -261,7 +261,7 @@ spec:
echo $container > /workspace/container_name

# Save the SBOM produced by Cachi2 so it can be merged into the final SBOM later
if [ -d "$(workspaces.source.path)/cachi2" ]; then
if [ -f "/tmp/cachi2/output/bom.json" ]; then
cp /tmp/cachi2/output/bom.json ./sbom-cachi2.json
fi

Expand Down Expand Up @@ -353,7 +353,7 @@ spec:
- name: merge-cachi2-sbom
image: quay.io/redhat-appstudio/cachi2:0.7.0@sha256:1fc772aa3636fd0b43d62120d832e5913843e028e8cac42814b487c3a0a32bd8
script: |
if [ -d "$(workspaces.source.path)/cachi2" ]; then
if [ -f "sbom-cachi2.json" ]; then
echo "Merging contents of sbom-cachi2.json into sbom-cyclonedx.json"
/src/utils/merge_syft_sbom.py sbom-cachi2.json sbom-cyclonedx.json > sbom-temp.json
mv sbom-temp.json sbom-cyclonedx.json
Expand Down