Sentry-cli on heroku


#1

I’m developing an Node.js + Angular app running on Heroku.

I have a script working fine locally with the sentry-cli to create releases, sync source-maps and associate commits. But it does not work in Heroku, fails with:

error: could not find repository from '.'; class=Repository (6); code=NotFound (-3)

I run the script in a post-install hook, but obviously I don’t have access to git from here (since it deleted by heroku according to this doc).

So what do people do if they wan’t to integrate Sentry and Heroku - is it event possible?


#2

Can you run sentry-cli with --log-level=debug and paste what it spits out?


#3

So I ended up adopting my Sentry-cli commands, to utilize the Heroku env variable: HEROKU_TEST_RUN_COMMIT_VERSION.

Something like this

VERSION="${HEROKU_TEST_RUN_COMMIT_VERSION}"

echo "The Sentry release-tasks script will now create release with id: '${VERSION}'"
sentry-cli releases new "$VERSION" -p <project>

sentry-cli releases set-commits --commit "owner/repo@${VERSION}" $VERSION

echo "Uploading sourcemaps"
sentry-cli releases -p <project> files $VERSION upload-sourcemaps ./path-to-sourcemaps/build --no-rewrite

And I actually think it works :slight_smile: