how to set variable in multiple steps in parallel.
Hi Nawang,
May you please clarify what is meant by setting variables in multiple steps? Do you mean setting a variable in a particular step, then sharing that value with other steps?
Cheers!
- Ben (Bitbucket Cloud Support)
Hello Ben,basically we want to setup global variable which can be called in different steps as required.Globalvariables: DEV_ENV: dev_CLUSTER DEVOPS_ENV: devops_CLUSTER VERSION: 1step: name: DEV script: - execute in $DEV_ENV with $VERSIONstep: name: DEVOPS variables: VERSION: 2 script: - execute in $DEVOPS_ENV with $VERSION
Hi @Nawang Lama
If you would like a static global environment variable that can be called across any step in the repository - you should configure a repository variable, these can be called as $VARIABLENAME as you have mentioned in your YML configuration:
If you would like an environment variable that can be set to different values throughout the course of your build, you would need to set the variable in the build - then pass it to other steps as an artifact, here is a Stack Overflow article that explains how to achieve this:
Hope this helps.
Hi @Ben Thank you very much for the message. I am using the same method now but will be much better if we can use variables in step it self for readability of the pipelines. Thank you.
It looks like you're new here. Sign in or register to get started.