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

Using variables in yaml to give more explicit names to pipeline steps

Lewis Mander
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 8, 2024

Hi All,

I would like to define the last two steps of my pipeline with more explicit names, i.e. it would be more useful for step 3. to display as: 'Deploy to UAT environment' and step 4. to display as: 'Deploy to QA environment'.

Would it be possible to define a variable which would populate these steps with the correct description when they run? As you can see in the attached, I have tried this in

- step: &code-analysis
name: "Deploy to ${{deployment}} environment"

pipline steps.jpg

but it's not working.
Any advice would be much appreciated.

Many thanks, Lewis

2 answers

1 vote
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 9, 2024

Hi Lewis and welcome to the community!

Variables are indeed referenced as either $foo or ${foo}, as Hariharan mentioned.

However, I'm afraid that it is not possible to reference variables in step names at the moment. This is not currently supported and the variables will not be substituted.

We have a feature request about this in our issue tracker, you can add your vote there (by selecting the Vote for this issue link) to express your interest:

In the meantime, you will need to use the value of each variable in the name instead of referencing the variable.

Please feel free to reach out if you have any questions.

Kind regards,
Theodora

1 vote
Hariharan Iyer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 8, 2024

Hi @Lewis Mander ,

 

It's difficult to provide an accurate response without seeing your entire pipeline file, but in general, the way to use variables is $foo or ${foo}, and not ${{foo}}. Please check this documentation for more details - https://support.atlassian.com/bitbucket-cloud/docs/variables-and-secrets/

 

Hope that helps!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events