✨ feat: update deployment scripts and configuration; enhance CI/CD process with new scripts for staging and production
This commit is contained in:
32
scripts/ci-upload-sourcemaps.sh
Executable file
32
scripts/ci-upload-sourcemaps.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# CI step: upload sourcemaps to Sentry
|
||||
# Called from .gitea/workflows/deploy.yml
|
||||
# Required env: SENTRY_AUTH_TOKEN (passed from workflow secrets)
|
||||
|
||||
# Read .env
|
||||
set -o allexport
|
||||
. ./.env
|
||||
set +o allexport
|
||||
|
||||
# Skip gracefully if no token is configured
|
||||
if [ -z "${SENTRY_AUTH_TOKEN:-}" ]; then
|
||||
echo "SENTRY_AUTH_TOKEN not set, skipping sourcemap upload"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "SENTRY_URL=${SENTRY_URL:-}"
|
||||
echo "SENTRY_ORG=${SENTRY_ORG:-}"
|
||||
echo "SENTRY_PROJECT=${SENTRY_PROJECT:-}"
|
||||
echo "PROJECT_RELEASE=${PROJECT_RELEASE:-}"
|
||||
|
||||
echo "Injecting debug IDs..."
|
||||
npx sentry-cli sourcemaps --log-level info inject frontend/dist
|
||||
|
||||
echo "Creating release and uploading sourcemaps..."
|
||||
npx sentry-cli sourcemaps --log-level info upload \
|
||||
--release="${PROJECT_RELEASE:-${SENTRY_PROJECT}.dirty}" \
|
||||
--url-prefix='~/dist' \
|
||||
--ext js --ext mjs --ext map \
|
||||
frontend/dist
|
||||
Reference in New Issue
Block a user