Sentry-cli: Start a release without knowing the new version number yet

Created on 4 Jul 2020  路  2Comments  路  Source: getsentry/sentry-cli

I am using standard-version to release my scripts. This tool uses lifecycle scripts that take care of bumping the version number, changing version number in files, committing and tagging the release. There seems to be no way to know, what the new version number is BEFORE the bump step ran. Is it possible to start a new version release without adding a name or changing the name later on? I would like to keep the releases based on the tag instead of letting sentry-cli propose a version name that is a long git hash.

# start release in prerelease lifecycle script - VERSION is not known here yet
./node_modules/.bin/sentry-cli releases new "$VERSION"

# finalize release in posttag lifecycle script
./node_modules/.bin/sentry-cli releases finalize "$VERSION"
./node_modules/.bin/sentry-cli releases set-commits --auto "$VERSION"

I have opened an issue on the other end to see if maybe standard-version is able to supply the new version number in the beginning before "bumping". See #607

releases question

All 2 comments

It's not possible to override the name, however, it is possible to override the start date.
So you can write something like this in your scripts:

# start the release script
timestamp=$(date +%s)

# bump versions, do build etc.

./node_modules/.bin/sentry-cli releases new "$VERSION"
./node_modules/.bin/sentry-cli releases finalize "$VERSION" --started $timestamp
./node_modules/.bin/sentry-cli releases set-commits --auto "$VERSION"

That does the trick, thank you :)

Was this page helpful?
0 / 5 - 0 ratings