File tree Expand file tree Collapse file tree 4 files changed +19
-6
lines changed Expand file tree Collapse file tree 4 files changed +19
-6
lines changed Original file line number Diff line number Diff line change 3
3
# Create release and upload sourcemaps to Sentry
4
4
# Must be run within project directory (e.g. './react/')
5
5
6
- USAGE=" Usage: ./sentry-release.sh ENV RELEASE"
6
+ USAGE=" Usage: ./sentry-release.sh ENV RELEASE UPLOAD_SOURCEMAPS \
7
+ UPLOAD_SOURCEMAPS = false | true"
7
8
8
9
set -e # exit immediately if any command exits with a non-zero status
9
10
@@ -12,7 +13,8 @@ echo "$0: Creating release and uploading source maps with sentry-cli..."
12
13
# Parse and validate command-line arguments
13
14
env=" $1 "
14
15
release=" $2 "
15
- if [[ " $env " == " " || " $release " == " " ]]; then
16
+ upload_sourcemaps=" $3 "
17
+ if [[ " $env " == " " || " $release " == " " || " $upload_sourcemaps " == " " ]]; then
16
18
echo " $0 : [error] missing required command-line arguments."
17
19
echo $USAGE
18
20
exit 1
32
34
sentry-cli releases -o $SENTRY_ORG new -p $sentry_project $release
33
35
sentry-cli releases -o $SENTRY_ORG finalize -p $sentry_project $release
34
36
sentry-cli releases -o $SENTRY_ORG -p $sentry_project set-commits --auto $release --ignore-missing
35
- sentry-cli releases -o $SENTRY_ORG -p $sentry_project files $release upload-sourcemaps --url-prefix " $sourcemaps_url_prefix " --validate " $sourcemaps_dir "
37
+ if [ " $upload_sourcemaps " == " true" ]; then
38
+ sentry-cli releases -o $SENTRY_ORG -p $sentry_project files $release upload-sourcemaps --url-prefix " $sourcemaps_url_prefix " --validate " $sourcemaps_dir "
39
+ fi
36
40
sentry-cli deploys -o $SENTRY_ORG new -p $sentry_project -r $release -e $env -n $env
Original file line number Diff line number Diff line change @@ -102,6 +102,7 @@ function cleanup {
102
102
rm -f $top /spring-boot/src/main/appengine/app.yaml
103
103
rm -f $top /spring-boot/src/main/resources/application.properties
104
104
rm -f $top /crons-python/crontab
105
+ rm -f $top /react/config-overrides.js
105
106
if [ " $generated_envs " != " " ]; then
106
107
rm -f $generated_envs # bash only (passed as separate args)
107
108
fi
@@ -165,7 +166,12 @@ for proj in $projects; do # bash only
165
166
./build.sh
166
167
167
168
if [[ " $fe_projects " = * " $proj " * ]]; then # project is frontend
168
- sentry-release.sh $env $RELEASE
169
+ if [[ " $proj " == " react" ]]; then
170
+ upload_sourcemaps=" false" # using webpack plugin
171
+ else
172
+ upload_sourcemaps=" true"
173
+ fi
174
+ sentry-release.sh $env $RELEASE $upload_sourcemaps
169
175
# NOTE: Sentry may create releases from events even without this step
170
176
fi
171
177
Original file line number Diff line number Diff line change 4
4
5
5
set -e # exit immediately if any command exits with a non-zero status
6
6
7
+ envsubst < config-overrides.js.template > config-overrides.js
8
+
7
9
rm -rf build
8
10
# npm ci does not update minor versions ->
9
11
# (1) less chance of breaking (2) less noise in PR from package-lock.json
10
12
npm ci
11
13
npm run build # defined in 'scripts' in package.json
14
+
Original file line number Diff line number Diff line change @@ -13,8 +13,8 @@ module.exports = function override(config, env) {
13
13
SentryWebpackPlugin.sentryWebpackPlugin({
14
14
authToken: process.env.SENTRY_AUTH_TOKEN,
15
15
include: '.',
16
- org : 'demo ' ,
17
- project : 'react ' ,
16
+ org: '${SENTRY_ORG} ',
17
+ project: '${REACT_SENTRY_PROJECT} ',
18
18
ignoreFile: '.sentrycliignore',
19
19
ignore: ['webpack.config.js'],
20
20
configFile: 'sentry.properties',
You can’t perform that action at this time.
0 commit comments