Environment Variable Flag

#1

What’s the appropriate way to create an environment variable that acts simply as a flag? For instance, in my scheduled builds, I’d like to store an environment variable indicating that the build was scheduled. To do so, I’d like to look for the presence of the key (e.g. $SCHEDULED_BUILD) but what is the appropriate value for the flag? Is an empty value (no value) sufficient? Or would the key not get set? In that case, just use something bogus? 1?

0 Likes

#2

I just opted to use a key with a bogus value (1) and test for the presence of that key by querying its value. Not sure if this the best practice or not in Bitrise, but it got the job done.

0 Likes