Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

It is possible to override a variables inside a pipeline YAML anchor?

Following the official documentation for YAML anchors: https://support.atlassian.com/bitbucket-cloud/docs/yaml-anchors/#Override-values, a question arises.

Since it is possible to make substitutions within a step, such as injecting a new name to the step. Is it possible to somehow inject a new value for a variable? Please see my example below to better explain my question.

definitions:
steps:
-step: &my-step
name: 'I want to replace this and I can'
script:
- export TO_BE_CHANGED='I want to replace this and I can not'

pipelines:
branches:
master:
-step:
<<: *my-step
name: 'Injecting new name'
$TO_BE_CHANGED = 'Injecting new value'

Is there any way to modify the value of the variable TO_BE_CHANGED?

 

Thank you

1 answer

0 votes

@Fernando Arteaga We don't currently support overriding variables. Have you considered using deployment environments to override variables?

I am working on the CI side for now, and I am not looking for automating the deployments yet.

Although I think it could be a super nice feature to override more things inside the definitions. It really could help to reduce the size of the bitbucket-pipelines.yml file and improve the code's reusability.

Thank you for the answer

Like # people like this

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

📣 Calling Bitbucket Data Center customers to participate in research

Hi everyone, Are you Bitbucket DC customer? If so, we'd love to talk to you! Our team wants to dive deep to understand your long-term plans regarding Bitbucket DC and Atlassian Cloud. Do you plan...

192 views 2 4
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you