Skip to content

Commit

Permalink
feat(ISV-5130): optionally enable SBOM processing
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Jediny <[email protected]>
  • Loading branch information
jedinym committed Nov 18, 2024
1 parent edb7fa5 commit 09955fb
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
8 changes: 8 additions & 0 deletions pipelines/rh-advisories/rh-advisories.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,10 @@ spec:
runAfter:
- collect-data
- name: create-product-sbom
when:
- input: "$(tasks.collect-atlas-params.results.secretName)"
operator: notin
values: [""]
params:
- name: dataJsonPath
value: "$(tasks.collect-data.results.data)"
Expand All @@ -561,6 +565,10 @@ spec:
runAfter:
- check-data-keys
- name: upload-product-sbom
when:
- input: "$(tasks.collect-atlas-params.results.secretName)"
operator: notin
values: [""]
params:
- name: sbomDir
value: "$(tasks.create-product-sbom.results.productSBOMPath)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,10 @@ spec:
runAfter:
- collect-data
- name: create-product-sbom
when:
- input: "$(tasks.collect-atlas-params.results.secretName)"
operator: notin
values: [""]
params:
- name: dataJsonPath
value: "$(tasks.collect-data.results.data)"
Expand All @@ -276,6 +280,10 @@ spec:
runAfter:
- check-data-keys
- name: upload-product-sbom
when:
- input: "$(tasks.collect-atlas-params.results.secretName)"
operator: notin
values: [""]
params:
- name: sbomDir
value: "$(tasks.create-product-sbom.results.productSBOMPath)"
Expand Down
12 changes: 6 additions & 6 deletions tasks/collect-atlas-params/collect-atlas-params.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ spec:
atlasServer=$(jq -r '.atlas.server' "$DATA_FILE")
if [ "$atlasServer" = "null" ]; then
echo "ERROR: The JSON file does not contain the 'atlasServer' field."
exit 1
fi
if [ "$atlasServer" = "stage" ]; then
# In this case, SBOM processing will be skipped.
bombasticApiUrl=""
ssoTokenUrl=""
secretName=""
elif [ "$atlasServer" = "stage" ]; then
bombasticApiUrl="https://sbom.atlas.release.stage.devshift.net"
ssoTokenUrl="https://auth.stage.redhat.com/auth/realms/EmployeeIDP/protocol/openid-connect/token"
secretName="atlas-staging-sso-secret"
Expand All @@ -65,7 +65,7 @@ spec:
ssoTokenUrl="https://auth.redhat.com/auth/realms/EmployeeIDP/protocol/openid-connect/token"
secretName="atlas-prod-sso-secret"
else
echo "ERROR: Unknown Atlas server value '$atlasServer'. Expected 'stage' or 'production'."
echo "ERROR: Unknown .atlas.server value '$atlasServer'. Expected 'stage' or 'production'."
exit 1
fi
Expand Down

0 comments on commit 09955fb

Please sign in to comment.