Files
triggerdotdev--trigger.dev/apps/webapp/upload-sourcemaps.sh
T
Eric Allam 09d0e80804 Add sentry error reporting (#2309)
* Sentry WIP

* Configure sentry for uploading and releasing during the publish webapp step

* Delete source maps after uploading

* Forward logger.error calls to sentry through Logger.onError

* Couple tweaks to the dockerfile
2025-07-24 15:09:50 +01:00

14 lines
546 B
Bash
Executable File

#!/bin/bash
set -eo pipefail
if [ -n "$SENTRY_ORG" ] && [ -n "$SENTRY_PROJECT" ] && [ -n "$SENTRY_AUTH_TOKEN" ] && [ -n "$SENTRY_RELEASE" ]; then
sentry-cli releases new $SENTRY_RELEASE
sentry-cli sourcemaps inject ./build
sentry-cli sourcemaps upload ./build --release $SENTRY_RELEASE
# Now we need to delete the sourcemaps from the build directory
rm -rf ./build/*.map
else
echo "Skipping sourcemap upload: Missing required environment variables"
echo "Required: SENTRY_ORG, SENTRY_PROJECT, SENTRY_AUTH_TOKEN, SENTRY_RELEASE"
fi