The SOURCE_BITRISE_BUILD_NUMBER var is empty

I’ve tried the approach described in this tutorial (https://medium.com/@bitrise/start-multiple-builds-with-the-same-trigger-on-bitrise-1d46ca847b9e), but it appears to be not working for me. Here are my steps:

  1. After build_router_start step, I’ve printed the value of SOURCE_BITRISE_BUILD_NUMBER env var in a script step and it’s just empty string:

echo “SOURCE_BITRISE_BUILD_NUMBER: ${SOURCE_BITRISE_BUILD_NUMBER}”
result: ‘’

  1. And the concurrent dependent build has the incremented version. I mean, triggered build has 172 build number and the concurrent one is 173…

As far as I understood the SOURCE_BITRISE_BUILD_NUMBER should have value and its value should be shared for both builds as the build number. Am I got it right?

It’s not correct.
SOURCE_BITRISE_BUILD_NUMBER is set in children builds only. It’s value is equal to $BITRISE_BUILD_NUMBER of parent build. See Starting parallel builds with a single trigger - Bitrise Docs

2 Likes

Well, I didn’t know that and this is not clear from the official tutorial IMHO.

After your clarifications, the SOURCE_BITRISE_BUILD_NUMBER env var works for me in the child build.

Thanks for the help @koral! It’s completely correct, the SOURCE part refers to the variable sharing the value of the original builds $BITRISE_BUILD_NUMBER

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.