-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(RELEASE-1214): add support for spdx sbom format
Based on the sbom type, we either run `upload_rpm_data` or `upload_rpm_data_cyclonedx`. Signed-off-by: Martin Malina <[email protected]>
- Loading branch information
Showing
8 changed files
with
160 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
105 changes: 105 additions & 0 deletions
105
tasks/push-rpm-data-to-pyxis/tests/test-push-rpm-data-to-pyxis-cyclonedx.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
--- | ||
apiVersion: tekton.dev/v1 | ||
kind: Pipeline | ||
metadata: | ||
name: test-push-rpm-data-to-pyxis-cyclonedx | ||
spec: | ||
description: | | ||
Run the push-rpm-data-to-pyxis task with required parameters and single arch | ||
images - a happy path scenario. The sboms are in cyclonedx format, so | ||
upload_rpm_data_cyclonedx script will be used. | ||
workspaces: | ||
- name: tests-workspace | ||
tasks: | ||
- name: setup | ||
workspaces: | ||
- name: data | ||
workspace: tests-workspace | ||
taskSpec: | ||
workspaces: | ||
- name: data | ||
steps: | ||
- name: setup-values | ||
image: quay.io/konflux-ci/release-service-utils:fb3aab1684422e897c2bac5acd57d5ecf42615ae | ||
script: | | ||
#!/usr/bin/env sh | ||
set -eux | ||
cat > $(workspaces.data.path)/pyxis_data.json << EOF | ||
{ | ||
"components": [ | ||
{ | ||
"containerImage": "imageurl1", | ||
"pyxisImages": [ | ||
{ | ||
"arch": "amd64", | ||
"imageId": "myImageID1cyclonedx", | ||
"digest": "mydigest1", | ||
"arch_digest": "mydigest1", | ||
"os": "linux" | ||
} | ||
] | ||
}, | ||
{ | ||
"containerImage": "imageurl2", | ||
"pyxisImages": [ | ||
{ | ||
"arch": "amd64", | ||
"imageId": "myImageID3cyclonedx", | ||
"digest": "mydigest2", | ||
"arch_digest": "mydigest2", | ||
"os": "linux" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
EOF | ||
- name: run-task | ||
taskRef: | ||
name: push-rpm-data-to-pyxis | ||
params: | ||
- name: pyxisJsonPath | ||
value: pyxis_data.json | ||
- name: pyxisSecret | ||
value: test-push-rpm-data-to-pyxis-cert | ||
- name: server | ||
value: production | ||
runAfter: | ||
- setup | ||
workspaces: | ||
- name: data | ||
workspace: tests-workspace | ||
- name: check-result | ||
workspaces: | ||
- name: data | ||
workspace: tests-workspace | ||
taskSpec: | ||
workspaces: | ||
- name: data | ||
steps: | ||
- name: check-result | ||
image: quay.io/konflux-ci/release-service-utils:fb3aab1684422e897c2bac5acd57d5ecf42615ae | ||
script: | | ||
#!/usr/bin/env sh | ||
set -eux | ||
if [ "$(wc -l < "$(workspaces.data.path)/mock_cosign.txt")" != 2 ]; then | ||
echo Error: cosign was expected to be called 2 times. Actual calls: | ||
cat "$(workspaces.data.path)/mock_cosign.txt" | ||
exit 1 | ||
fi | ||
if [ "$(wc -l < "$(workspaces.data.path)/mock_upload_rpm_data_cyclonedx.txt")" != 2 ]; then | ||
echo Error: upload_rpm_data_cyclonedx was expected to be called 2 times. Actual calls: | ||
cat "$(workspaces.data.path)/mock_upload_rpm_data_cyclonedx.txt" | ||
exit 1 | ||
fi | ||
if [ "$(wc -l < "$(workspaces.data.path)/mock_select-oci-auth.txt")" != 2 ]; then | ||
echo Error: select-oci-with was expected to be called 2 times. Actual calls: | ||
cat "$(workspaces.data.path)/mock_select-oci-auth.txt" | ||
exit 1 | ||
fi | ||
runAfter: | ||
- run-task |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters