So, my process is to create a build using ionic build, commit the code and then run the release.
SENTRY_ORG=company-name
SENTRY_PROJECT=project-name
VERSION=`sentry-cli releases propose-version`
SOURCEMAP_LOCATION?=build/static/js
setup_release: config build create_release associate_commits
create_release:
sentry-cli releases -o $(SENTRY_ORG) new -p $(SENTRY_PROJECT) $(VERSION)
associate_commits:
sentry-cli releases -o $(SENTRY_ORG) -p $(SENTRY_PROJECT) set-commits --local $(VERSION)
upload_sourcemaps:
sentry-cli releases -o $(SENTRY_ORG) -p $(SENTRY_PROJECT) files \
$(VERSION) upload-sourcemaps --url-prefix="~/static/js/" --rewrite --validate $(SOURCEMAP_LOCATION)
config:
sed -i s/^react_app_sentry_release=.*/react_app_sentry_release=${VERSION}/ .env
# Deploy targets
build:
npm run build
deploy: setup_release
make upload_sourcemaps
This file is straight from Mike’s demo.
The differences I can see is that this file is using sentry-cli releases propose-version
to create the version whereas it seems that you’re creating a version from what’s specified in your package.json file, and the other is that you specified --no-rewrite
instead of --rewrite
in my case.
I tried releasing my code with the --no-rewrite
but it didn’t have any effect.
I’ve included the output from running the file, below.
λ make deploy
sed -i s/^react_app_sentry_release=.*/react_app_sentry_release=`sentry-cli releases propose-version`/ .env
sentry-cli releases -o insight-consulting new -p engage `sentry-cli releases propose-version`Created release d12345dade15d6b69d92e1e859a4de1fdc6e1234.
sentry-cli releases -o insight-consulting -p engage set-commits --local `sentry-cli releases propose-version`
Could not find the previous commit. Creating a release with 20 commits.
Success! Set commits for release d12345dade15d6b69d92e1e859a4de1fdc6e1234.
make upload_sourcemaps
make[1]: Entering directory '/cygdrive/c/Work/Mobile/App-Name'
sentry-cli releases -o company-name -p app-name files \
`sentry-cli releases propose-version` upload-sourcemaps --url-prefix="~/static/js/" --no-rewrite --validate build/static/js
> Found 200 release files
> Analyzing 200 sources
> Adding source map references
> Validating sources 0> Bundled 200 files for upload
> Uploaded release files to Sentry 0> File upload complete
)
Source Map Upload Report
Minified Scripts
~/static/js/0.6ebe04ee.chunk.js (sourcemap at 0.6ebe04ee.chunk.js.map)
~/static/js/1.4126f806.chunk.js (sourcemap at 1.4126f806.chunk.js.map)
list of all the generated files...