Skip to content

Commit 5991a95

Browse files
Paul Hewletteccles
authored andcommitted
SBOM scraper output change
Problem: SBOM endpointvin archivist now outputs metadata and not uuid Solution: Use jq (if available) to output the metadata. Signed-off-by: Paul Hewlett <[email protected]>
1 parent 3c98468 commit 5991a95

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

credentials/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*
2+
!.gitignore
3+

scripts/sbom_scraper.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ then
2626
echo "syft command not found"
2727
exit 10
2828
fi
29+
JQ=$(which jq)
30+
if [ -z "${JQ}" ]
31+
then
32+
JQ="cat"
33+
else
34+
JQ="jq ."
35+
fi
2936

3037
set -e
3138
set -u
@@ -59,7 +66,7 @@ Usage: $SCRIPTNAME [-c clientsecretfile] [-o output format] [-s sbomFile ] [-u u
5966
6067
Example:
6168
62-
$0 -o spdx 29b48af4-45ca-465b-b136-206674f8aa9b ubuntu:21.10
69+
$0 29b48af4-45ca-465b-b136-206674f8aa9b ubuntu:21.10
6370
6471
EOF
6572

@@ -172,6 +179,6 @@ then
172179
log "Upload failure ${HTTP_STATUS}"
173180
exit 4
174181
fi
175-
UUID=$(cat "${TEMPDIR}/upload")
176-
log "Upload success: uuid=${UUID}"
182+
log "Upload success: "
183+
${JQ} "${TEMPDIR}/upload"
177184
exit 0

0 commit comments

Comments
 (0)