Skip to content

Commit 3c9bc37

Browse files
authored
Merge pull request #95 from jduimovich/tree-fix
fix cosign login and tree command
2 parents 3f27d6b + 8567b47 commit 3c9bc37

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

rhtap/show-sbom-rhdh.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ function show-sbom() {
1414
echo -n "."
1515
status=0
1616
echo
17+
image_registry="${IMAGE_URL/\/*/}"
18+
# If the repo is not publicly accessible we need to authenticate so ec can access it
19+
prepare-registry-user-pass $image_registry
20+
echo "cosign login to registry $image_registry"
21+
cosign login --username="$IMAGE_REGISTRY_USER" --password="$IMAGE_REGISTRY_PASSWORD" $image_registry
1722
echo "SBOM_EYECATCHER_BEGIN"
1823
cosign download sbom $IMAGE_URL 2>> $RESULTS/err
1924
status=$?

rhtap/summary.sh

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,22 @@ function appstudio-summary() {
2323
echo End Summary
2424

2525
}
26+
# missing tree command
27+
function showTree() {
28+
find $1 | sed -e "s/[^-][^\/]*\// ├─/g" -e "s/|\([^ ]\)/|─\1/"
29+
}
30+
function cosignTree() {
31+
URL=$1
32+
image_registry="${URL/\/*/}"
33+
# If the repo is not publicly accessible we need to authenticate so ec can access it
34+
prepare-registry-user-pass $image_registry
35+
echo "cosign login to registry $image_registry"
36+
cosign login --username="$IMAGE_REGISTRY_USER" --password="$IMAGE_REGISTRY_PASSWORD" $image_registry
37+
cosign tree $URL
38+
}
2639

2740
# Task Steps
2841
appstudio-summary
29-
tree $BASE_RESULTS
30-
cosign tree $IMAGE_URL
42+
showTree $BASE_RESULTS
43+
cosignTree $IMAGE_URL
3144
exit_with_success_result

0 commit comments

Comments
 (0)