Skip to content

Commit

Permalink
Print more debug info if kosli attest fails
Browse files Browse the repository at this point in the history
  • Loading branch information
JonJagger committed May 19, 2024
1 parent be8f6a9 commit c61748d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion snyk_scan_live_artifacts_and_attest_to_kosli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,12 @@ attest_snyk_scan_to_kosli_trail()
# Do attestation on the Flow+Trail representing this live-snyk-scan use-case.
# Don't do attestation at the Artifact level because that would make
# KOSLI_FLOW appear as an extra Flow in the Environment snapshots.
rm /tmp/user-data.json || true
printf '{"artifact_name": "%s", "fingerprint": "%s"}' "${artifact_name}" "${fingerprint}" > /tmp/user-data.json

set +e
kosli attest snyk \
--user-data=<(printf '{"artifact_name": "%s", "fingerprint": "%s"}' "$artifact_name" "$fingerprint") \
--user-data=/tmp/user-data.json \
--flow="${KOSLI_FLOW}" \
--trail="${KOSLI_TRAIL}" \
--name="${repo}" \
Expand All @@ -123,7 +126,12 @@ attest_snyk_scan_to_kosli_trail()
echo "-------------------------------"
echo ERROR: failed to attest snyk results to Trail representing the live-snyk-scan
echo kosli attest snyk --flow="${KOSLI_FLOW}" --trail="${KOSLI_TRAIL}" --name="${repo}"
echo
echo kosli.snyk.trail.log
cat /tmp/kosli.snyk.trail.log
echo
echo user-data.json
cat /tmp/user-data.json
exit ${STATUS}
fi

Expand Down

0 comments on commit c61748d

Please sign in to comment.