generated from RedHatInsights/frontend-starter-app
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(RHINENG-15390): Onboard OCP Advisor to Sentry Instance (#879)
- Loading branch information
1 parent
0d5f8eb
commit cc6fdf4
Showing
5 changed files
with
716 additions
and
353 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: sentryInit | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
workflow_dispatch: | ||
inputs: | ||
commit_hash: | ||
description: 'The commit hash (or branch/tag) to build' | ||
required: false | ||
default: '' | ||
|
||
jobs: | ||
createSentryRelease: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.inputs.commit_hash || 'refs/heads/master' }} | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Build | ||
env: | ||
ENABLE_SENTRY: ${{ secrets.ENABLE_SENTRY }} | ||
SENTRY_RELEASE: ${{ github.event.inputs.commit_hash && github.event.inputs.commit_hash }} | ||
SENTRY_AUTH_TOKEN: ${{ github.event.inputs.commit_hash && secrets.SENTRY_AUTH_TOKEN }} | ||
SENTRY_ORG: ${{ secrets.SENTRY_ORG }} | ||
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }} | ||
run: npm run build --if-present |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,4 +31,6 @@ cypress/screenshots | |
cypress/videos | ||
|
||
# cache | ||
.cache/ | ||
.cache/ | ||
# Sentry Config File | ||
.env.sentry-build-plugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
const { resolve } = require('path'); | ||
const { sentryWebpackPlugin } = require('@sentry/webpack-plugin'); | ||
|
||
module.exports = { | ||
appUrl: '/openshift/insights/advisor', | ||
|
@@ -12,7 +13,27 @@ module.exports = { | |
/** | ||
* Add additional webpack plugins | ||
*/ | ||
plugins: [], | ||
devtool: 'hidden-source-map', | ||
plugins: [ | ||
// Put the Sentry Webpack plugin after all other plugins | ||
...(process.env.ENABLE_SENTRY | ||
? [ | ||
sentryWebpackPlugin({ | ||
...(process.env.SENTRY_AUTH_TOKEN && { | ||
authToken: process.env.SENTRY_AUTH_TOKEN, | ||
}), | ||
org: 'red-hat-it', | ||
project: 'ocp-advisor', | ||
moduleMetadata: ({ release }) => ({ | ||
dsn: `https://[email protected]/4508683272454144`, | ||
org: 'red-hat-it', | ||
project: 'ocp-advisor', | ||
release, | ||
}), | ||
}), | ||
] | ||
: []), | ||
], | ||
...(process.env.HOT | ||
? { hotReload: process.env.HOT === 'true' } | ||
: { hotReload: true }), | ||
|
Oops, something went wrong.