Skip to content

Commit

Permalink
Add Sentry-CLI for sourcemaps
Browse files Browse the repository at this point in the history
  • Loading branch information
GODrums committed Dec 7, 2024
1 parent bc873d3 commit 268a2ec
Show file tree
Hide file tree
Showing 5 changed files with 231 additions and 10 deletions.
1 change: 1 addition & 0 deletions webapp/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ EOF

RUN npm install
RUN npm run build
RUN npx sentry-cli sourcemaps inject --org aet --project hephaestus ./dist/webapp && sentry-cli sourcemaps upload --org aet --project hephaestus --release=${SENRY_RELEASE} ./dist/webapp

FROM nginx:latest

Expand Down
232 changes: 224 additions & 8 deletions webapp/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"prettier:check": "prettier --check src/",
"prettier:write": "prettier --write src/",
"lint": "eslint",
"lint:fix": "eslint --fix"
"lint:fix": "eslint --fix",
"sentry:sourcemaps": "sentry-cli sourcemaps inject --org aet --project hephaestus ./dist/webapp && sentry-cli sourcemaps upload --org aet --project hephaestus --release=0.0.1 ./dist/webapp"
},
"private": true,
"engines": {
Expand All @@ -34,6 +35,7 @@
"@ng-icons/octicons": "29.5.0",
"@primer/primitives": "9.1.1",
"@sentry/angular": "^8.42.0",
"@sentry/cli": "^2.39.1",
"@spartan-ng/ui-accordion-brain": "0.0.1-alpha.356",
"@spartan-ng/ui-alertdialog-brain": "0.0.1-alpha.356",
"@spartan-ng/ui-avatar-brain": "0.0.1-alpha.356",
Expand Down
2 changes: 2 additions & 0 deletions webapp/src/app/core/sentry/sentry.error-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ export class SentryErrorHandler extends ErrorHandler {
return;
}

console.log('Initializing Sentry: ', env.version);

Sentry.init({
dsn: env.sentry.dsn,
release: env.version,
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/environments/environment.prod.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export const environment = {
clientUrl: 'http://localhost:4200',
serverUrl: 'http://localhost:8080',
version: '0.0.1',
version: '0.0.2',
sentry: {
dsn: 'https://[email protected]/3',
environment: 'prod'
Expand Down

0 comments on commit 268a2ec

Please sign in to comment.