Hi all - this is the first RFC we've done via this community, but we'd like to make this a regular thing depending on how engagement goes with this attempt.
This RFC is to gather ideas/feedback on our implementation for Step-level Variable Sharing. A new feature coming soon to Pipelines.
This feature will allow users to share environment variables between steps. A variable can be defined in one step, and subsequent steps in the same pipeline will have access to that variable.
Currently, there is no standard way to achieve this. There are workarounds available, the one most often used is to save variables in an artifact file, and use that artifact in subsequent steps to set variables. This is a functional solution, but not recommended because
It involves custom logic that is not using artifacts for their intended purpose
It’s annoying and non-intuitive for customers to use this approach
Variables produced this way can easily override other variables when they maybe should not
Users can save variables to a step-level variable object. At completion of the step, these variables are extracted and saved as pipeline-level variables, which are imported into subsequent steps.
step:
script:
echo "MY_VARIABLE=some_value" >> $BITBUCKET_STEP_VARIABLES
Edmund Munday
Principal Product Manager - Bitbucket Cloud
Atlassian
Melbourne, Australia
11 accepted answers
6 comments