Skip to content

Commit

Permalink
feat(webpack): submit source maps to sentry
Browse files Browse the repository at this point in the history
  • Loading branch information
thejoeejoee committed Nov 17, 2023
1 parent 6734af2 commit 05ae808
Show file tree
Hide file tree
Showing 5 changed files with 271 additions and 9 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ jobs:
cache-to: type=gha,mode=max
tags: ${{ steps.webMeta.outputs.tags }}
labels: ${{ steps.webMeta.outputs.labels }}
secrets: |
SENTRY_ORG=${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT=${{ secrets.SENTRY_PROJECT }}
SENTRY_WEBPACK_AUTH_TOKEN=${{ secrets.SENTRY_WEBPACK_AUTH_TOKEN }}
- name: Prepare image metadata
id: proxyMeta
Expand Down Expand Up @@ -98,6 +102,10 @@ jobs:
cache-to: type=gha,mode=max
tags: ${{ steps.proxyMeta.outputs.tags }}
labels: ${{ steps.proxyMeta.outputs.labels }}
secrets: |
SENTRY_ORG=${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT=${{ secrets.SENTRY_PROJECT }}
SENTRY_WEBPACK_AUTH_TOKEN=${{ secrets.SENTRY_WEBPACK_AUTH_TOKEN }}
deploy:
name: Deploy to cluster
Expand Down
9 changes: 8 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,14 @@ ENV PUBLIC_PATH=${PUBLIC_PATH}
ARG TAILWIND_CONTENT_PATH="/usr/src/fiesta/**/templates/**/*.html:/usr/src/fiesta/**/*.py"
ENV TAILWIND_CONTENT_PATH=${TAILWIND_CONTENT_PATH}

RUN ["yarn", "build"]
RUN \
--mount=type=secret,id=SENTRY_ORG \
--mount=type=secret,id=SENTRY_PROJECT \
--mount=type=secret,id=SENTRY_WEBPACK_AUTH_TOKEN \
export SENTRY_ORG=$(cat /run/secrets/SENTRY_ORG) \
export SENTRY_PROJECT=$(cat /run/secrets/SENTRY_PROJECT) \
export SENTRY_WEBPACK_AUTH_TOKEN=$(cat /run/secrets/SENTRY_WEBPACK_AUTH_TOKEN) \
&& yarn build

#
# django web app image
Expand Down
1 change: 1 addition & 0 deletions webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"dependencies": {
"@alpinejs/collapse": "^3.13.2",
"@alpinejs/persist": "^3.13.2",
"@sentry/webpack-plugin": "^2.10.1",
"@tailwindcss/forms": "^0.5.6",
"@tailwindcss/typography": "^0.5.10",
"alpinejs": "^3.13.2",
Expand Down
9 changes: 8 additions & 1 deletion webpack/webpack.prod.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
const config = require('./webpack.base.config.js');
const webpack = require('webpack');
const {
sentryWebpackPlugin
} = require("@sentry/webpack-plugin");

config.plugins.push(
new webpack.DefinePlugin({
// '__SENTRY_DSN__': '\'' + process.env.SENTRY_DSN + '\'',
'__DEVELOPMENT__': 'false',
}),
sentryWebpackPlugin({
authToken: process.env.SENTRY_WEBPACK_AUTH_TOKEN,
org: process.env.SENTRY_ORG,
project: process.env.SENTRY_PROJECT,
})
);

Object.assign(
Expand Down
Loading

0 comments on commit 05ae808

Please sign in to comment.