overleaf/services/web/bin/sentry_upload
Jakob Ackermann a96716f8cf Merge pull request #4382 from overleaf/jpa-sentry-upload
[misc] sentry_upload: gracefully handle initial upload from monorepo

GitOrigin-RevId: 49e789a4cfc23e996ebaddd1ea015c11f6c08573
2021-08-05 02:08:10 +00:00

18 lines
544 B
Bash
Executable file

#!/bin/sh
set -e
if [[ "$BRANCH_NAME" == "master" || "$BRANCH_NAME" == "main" ]]; then
rm -rf sentry_upload
mkdir sentry_upload
tar --directory sentry_upload -xf build.tar
cd sentry_upload/public
SENTRY_RELEASE=${COMMIT_SHA}
OPTS="--no-rewrite --url-prefix ~"
sentry-cli releases new "$SENTRY_RELEASE"
sentry-cli releases files "$SENTRY_RELEASE" upload-sourcemaps ${OPTS} .
sentry-cli releases set-commits --auto --ignore-missing "$SENTRY_RELEASE"
sentry-cli releases finalize "$SENTRY_RELEASE"
rm -rf sentry_upload
fi