Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

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

0 votes
Norbert C
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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events