The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Pipeline: variable value based on the branch

Admin Admin
February 22, 2022

Hello,

 id like to set the (docker) tag value based on the branch ( or rather PR ).

Something like :

 set TAG = "latest" when PR on master branch

else

set TAG ="$BITBUCKET_BUILD"

 

Thank you

 

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Norbert Csupka
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 25, 2022

Hi @Admin Admin 

Thank you for contacting Atlassian Community, my name is Norbert and I'm a Bitbucket Cloud Support, it's nice to talk with you!

I would like to inform you that we had a feature request for this, but our developer team closed it as a "Won't Fix"
BCLOUD-12923 - Branch-Specific Environment Variables

As a workaround what I would like to suggest you is to set environmental variable at the beginning of the script:

script:
  - export TAG="$SECRET_PROD"

Please let us know if this solutions helps.

Best Regards,
Norbert
Atlassian Bitbucket Cloud Support

TAGS
AUG Leaders

Atlassian Community Events