Skip to content

Commit 9c8813a

Browse files
author
James Lowman
committed
Revert "Accidental push to main"
This reverts commit 8a8d2b8.
1 parent 8a8d2b8 commit 9c8813a

File tree

1 file changed

+3
-19
lines changed

1 file changed

+3
-19
lines changed

scripts/sbom_scraper.sh

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ SUPPLIER_NAME=dockerhub
6767
SUPPLIER_URL=https://hub.docker.com
6868
TOOL_VENDOR="Jitsuin Inc"
6969
TOOL_HASH_ALG=SHA-256
70-
SBOM_UPLOAD_TIMEOUT=10
7170
# shellcheck disable=SC2002
7271
TOOL_HASH_CONTENT=$(shasum -a 256 "$0" | cut -d' ' -f1)
7372
# credentials directory should have 0700 permissions
@@ -367,32 +366,17 @@ EOF
367366
# ----------------------------------------------------------------------------
368367
log "Upload ${PRIVACY} ${OUTPUT} ..."
369368

370-
HTTP_STATUS=$(timeout ${SBOM_UPLOAD_TIMEOUT} \
371-
curl -s -w "%{http_code}" -X POST \
369+
HTTP_STATUS=$(curl -s -w "%{http_code}" -X POST \
372370
-o "${TEMPDIR}/upload" \
373371
-H "@${BEARER_TOKEN_FILE}" \
374372
-H "content_type=text/xml" \
375373
-F "sbom=@${PATCHED_OUTPUT}" \
376374
"${URL}/archivist/v1/sboms?privacy=${PRIVACY}")
377375

378-
RETURN_CODE=$?
379-
380-
# timeout returns 124 if the command exceeded the time limit
381-
if [ ${RETURN_CODE} -eq 124 ]
382-
then
383-
log "Upload failure: Timeout"
384-
exit 3
385-
# all other non-zero return codes
386-
elif [ ${RETURN_CODE} -gt 0 ]
387-
then
388-
log "Upload failure: Error code ${RETURN_CODE}"
389-
exit 4
390-
fi
391-
392376
if [ "${HTTP_STATUS}" != "200" ]
393377
then
394-
log "Upload failure: HTTP ${HTTP_STATUS}"
395-
exit 5
378+
log "Upload failure ${HTTP_STATUS}"
379+
exit 4
396380
fi
397381
log "Upload success: "
398382
jq . "${TEMPDIR}/upload"

0 commit comments

Comments
 (0)