overleaf/services/web/bin/sentry_upload
Alf Eaton a9fac2370b Upgrade Sentry SDK (#20806)
GitOrigin-RevId: 70cfbfd7f2ae61bbc865d32c576aa8f195837fb5
2024-10-14 11:01:28 +00:00

19 lines
566 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}
sentry-cli releases new "$SENTRY_RELEASE"
sentry-cli releases set-commits --auto "$SENTRY_RELEASE"
sentry-cli files upload --release="$SENTRY_RELEASE" .
sentry-cli sourcemaps inject .
sentry-cli sourcemaps upload --no-rewrite --url-prefix ~ .
sentry-cli releases finalize "$SENTRY_RELEASE"
rm -rf sentry_upload
fi