Skip to content

Commit

Permalink
Merge pull request #95 from jduimovich/tree-fix
Browse files Browse the repository at this point in the history
fix cosign login and tree command
  • Loading branch information
jduimovich authored Nov 27, 2024
2 parents 3f27d6b + 8567b47 commit 3c9bc37
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
5 changes: 5 additions & 0 deletions rhtap/show-sbom-rhdh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ function show-sbom() {
echo -n "."
status=0
echo
image_registry="${IMAGE_URL/\/*/}"
# If the repo is not publicly accessible we need to authenticate so ec can access it
prepare-registry-user-pass $image_registry
echo "cosign login to registry $image_registry"
cosign login --username="$IMAGE_REGISTRY_USER" --password="$IMAGE_REGISTRY_PASSWORD" $image_registry
echo "SBOM_EYECATCHER_BEGIN"
cosign download sbom $IMAGE_URL 2>> $RESULTS/err
status=$?
Expand Down
17 changes: 15 additions & 2 deletions rhtap/summary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,22 @@ function appstudio-summary() {
echo End Summary

}
# missing tree command
function showTree() {
find $1 | sed -e "s/[^-][^\/]*\// ├─/g" -e "s/|\([^ ]\)/|─\1/"
}
function cosignTree() {
URL=$1
image_registry="${URL/\/*/}"
# If the repo is not publicly accessible we need to authenticate so ec can access it
prepare-registry-user-pass $image_registry
echo "cosign login to registry $image_registry"
cosign login --username="$IMAGE_REGISTRY_USER" --password="$IMAGE_REGISTRY_PASSWORD" $image_registry
cosign tree $URL
}

# Task Steps
appstudio-summary
tree $BASE_RESULTS
cosign tree $IMAGE_URL
showTree $BASE_RESULTS
cosignTree $IMAGE_URL
exit_with_success_result

0 comments on commit 3c9bc37

Please sign in to comment.