Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Offset the Bitrise.io $BITRISE_BUILD_NUMBER
#!/bin/bash
set -e
if [ -z "$BITRISE_BUILD_NUMBER" ] ; then
echo " [!] BITRISE_BUILD_NUMBER not provided"
exit 1
fi
echo "=> Original BITRISE_BUILD_NUMBER: $BITRISE_BUILD_NUMBER"
set -x
build_number_offset=23
new_build_num=$(($BITRISE_BUILD_NUMBER + $build_number_offset))
envman add --key BITRISE_BUILD_NUMBER --value $new_build_num
@viktorbenei

This comment has been minimized.

Copy link
Owner Author

@viktorbenei viktorbenei commented Dec 4, 2015

Drop this into a Script step and set the build_number_offset=23 to the value you want to use.

@jpike88

This comment has been minimized.

Copy link

@jpike88 jpike88 commented Sep 15, 2016

Awesome! Thanks. Would be nice to be able to override the build number to skip a few numbers, as some existing projects already have build numbers at 40, 50 etc

@jpike88

This comment has been minimized.

Copy link

@jpike88 jpike88 commented Sep 15, 2016

(by override I mean set it outright without the ability to decrement it, saves this step)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment