The SOURCE_BITRISE_BUILD_NUMBER var is empty

#1

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?

0 Likes

#2

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 https://devcenter.bitrise.io/builds/triggering-builds/trigger-multiple-workflows/

2 Likes

#3

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.

0 Likes

#4

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

0 Likes

closed #5

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

0 Likes