Skip to content

Instantly share code, notes, and snippets.

@viktorbenei
Created December 4, 2015 14:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save viktorbenei/13712ccd5752b4cfa772 to your computer and use it in GitHub Desktop.
Save viktorbenei/13712ccd5752b4cfa772 to your computer and use it in GitHub Desktop.
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
Copy link
Author

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

@jpike88
Copy link

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
Copy link

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