diff --git a/rhtap/show-sbom-rhdh.sh b/rhtap/show-sbom-rhdh.sh index c9e32c6..c03bb4f 100755 --- a/rhtap/show-sbom-rhdh.sh +++ b/rhtap/show-sbom-rhdh.sh @@ -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=$? diff --git a/rhtap/summary.sh b/rhtap/summary.sh index ebbad1e..4a606a6 100755 --- a/rhtap/summary.sh +++ b/rhtap/summary.sh @@ -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