You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
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
@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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.