switch source map publish to runtime in entrypoint

This commit is contained in:
msukkari 2025-03-01 20:43:23 -08:00
parent 99fda9a443
commit d33185c118
4 changed files with 9 additions and 12 deletions

View file

@ -29,15 +29,6 @@ jobs:
platform=${{ matrix.platform }} platform=${{ matrix.platform }}
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
- name: Setup Sentry CLI
uses: matbour/setup-sentry-cli@v1
with:
version: latest
- name: Login to Sentry
run: |
sentry-cli login --auth-token ${{ secrets.SENTRY_AUTH_TOKEN }}
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:

View file

@ -145,6 +145,7 @@ COPY --from=shared-libs-builder /app/packages/error ./packages/error
# Configure dependencies # Configure dependencies
RUN apk add --no-cache git ca-certificates bind-tools tini jansson wget supervisor uuidgen curl perl jq redis postgresql postgresql-contrib openssl util-linux unzip RUN apk add --no-cache git ca-certificates bind-tools tini jansson wget supervisor uuidgen curl perl jq redis postgresql postgresql-contrib openssl util-linux unzip
RUN curl -sL https://sentry.io/get-cli/ | sh
# Install grafana alloy. libc6-compat is required because alloy dynamically links against glibc which doesn't exist in alpine by default # Install grafana alloy. libc6-compat is required because alloy dynamically links against glibc which doesn't exist in alpine by default
# @nochekin: figure out how to handle this for self hosted case (especially the config) # @nochekin: figure out how to handle this for self hosted case (especially the config)

View file

@ -187,6 +187,12 @@ echo "{\"version\": \"$SOURCEBOT_VERSION\", \"install_id\": \"$SOURCEBOT_INSTALL
# done # done
# } # }
# Upload sourcemaps to Sentry
# @nocheckin
su -c "sentry-cli login --auth-token $SENTRY_AUTH_TOKEN"
su -c "sentry-cli sourcemaps inject --org sourcebot --project backend /app/packages/backend/dist"
su -c "sentry-cli sourcemaps upload --org sourcebot --project backend /app/packages/backend/dist"
# Start the database and wait for it to be ready before starting any other service # Start the database and wait for it to be ready before starting any other service
if [ "$DATABASE_URL" = "postgresql://postgres@localhost:5432/sourcebot" ]; then if [ "$DATABASE_URL" = "postgresql://postgres@localhost:5432/sourcebot" ]; then

View file

@ -7,9 +7,8 @@
"scripts": { "scripts": {
"dev:watch": "tsc-watch --preserveWatchOutput --onSuccess \"yarn dev --cacheDir ../../.sourcebot\"", "dev:watch": "tsc-watch --preserveWatchOutput --onSuccess \"yarn dev --cacheDir ../../.sourcebot\"",
"dev": "export PATH=\"$PWD/../../bin:$PATH\" && export CTAGS_COMMAND=ctags && node ./dist/index.js", "dev": "export PATH=\"$PWD/../../bin:$PATH\" && export CTAGS_COMMAND=ctags && node ./dist/index.js",
"build": "tsc && yarn sentry:sourcemaps", "build": "tsc",
"test": "vitest --config ./vitest.config.ts", "test": "vitest --config ./vitest.config.ts"
"sentry:sourcemaps": "sentry-cli sourcemaps inject --org sourcebot --project backend ./dist && sentry-cli sourcemaps upload --org sourcebot --project backend ./dist"
}, },
"devDependencies": { "devDependencies": {
"@types/argparse": "^2.0.16", "@types/argparse": "^2.0.16",