Require SENTRY_AUTH_TOKEN for Sentry dSYM upload
Warn and skip upload when SENTRY_AUTH_TOKEN is not set. Invoke sentry-cli with --auth-token, --org and --project flags and attempt an upload including sources, falling back to a plain dSYM upload on failure. Changelog-None Closes: #3767 Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
This commit is contained in:
@@ -25,12 +25,14 @@ if [ ! -d "${DSYM_PATH}" ]; then
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export SENTRY_ORG=damus-nostr-inc
|
if [ -z "${SENTRY_AUTH_TOKEN:-}" ]; then
|
||||||
export SENTRY_PROJECT=apple-ios
|
echo "warning: SENTRY_AUTH_TOKEN is not set, skipping Sentry dSYM upload"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
if ! error_output=$(sentry-cli debug-files upload --include-sources "${DSYM_PATH}" 2>&1); then
|
if ! error_output=$(sentry-cli debug-files upload --auth-token "${SENTRY_AUTH_TOKEN}" --org damus-nostr-inc --project apple-ios --include-sources "${DSYM_PATH}" 2>&1); then
|
||||||
echo "warning: sentry-cli failed to upload dSYMs with sources from ${DSYM_PATH}: ${error_output}"
|
echo "warning: sentry-cli failed to upload dSYMs with sources from ${DSYM_PATH}: ${error_output}"
|
||||||
if ! error_output=$(sentry-cli debug-files upload "${DSYM_PATH}" 2>&1); then
|
if ! error_output=$(sentry-cli debug-files upload --auth-token "${SENTRY_AUTH_TOKEN}" --org damus-nostr-inc --project apple-ios "${DSYM_PATH}" 2>&1); then
|
||||||
echo "warning: sentry-cli failed to upload dSYMs from ${DSYM_PATH}: ${error_output}"
|
echo "warning: sentry-cli failed to upload dSYMs from ${DSYM_PATH}: ${error_output}"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user