Use variables in any part of your Pipelines .yaml

In the past, variables in Bitbucket Pipelines were scoped to only operate within script sections of a Pipelines workflow. This limited their usefulness and restricted users from being able to fully parameterize their workflows.

Today we are releasing an enhancement that will allow variables to be used within any section of a Pipelines .yaml file, and not just within scripts. This new capability will allow you to use variables to parameterize things like cache keys, artifact names, build images, and anything else you might need.

How it works

Templating variables into your .yaml file is done via a simple, standardized templating syntax (${{MY_VARIABLE_KEY}}) that many users will already be familiar with from other tools. Simply wrap the key of the variable you want to template into your .yaml between the ${{ }} tags, and the system will take care of the rest.

Example:

image: ${{IMAGE_NAME}}
definitions:
  caches:
    ${{CACHE_NAME}}: ${{CACHE_PATH}}

For more detailed information, check out the Variables and secrets help document.

Published

in

Related Content

More in ‘

Warning: Undefined array key “link” in /srv/users/atlassian/apps/atlassianstaging/public/wp-content/plugins/curator/template-parts/cards/article-card.php on line 119
Company News
Announcing social enterprise discounts: Atlassian tools for social impact teams

Warning: Undefined array key “link” in /srv/users/atlassian/apps/atlassianstaging/public/wp-content/plugins/curator/template-parts/cards/article-card.php on line 119
Leadership
Great managers meet uncertainty with curiosity and confidence

Warning: Undefined array key “link” in /srv/users/atlassian/apps/atlassianstaging/public/wp-content/plugins/curator/template-parts/cards/article-card.php on line 119
Company News
Introducing Databricks Query Runner: Transforming data into insight

Warning: Undefined array key “link” in /srv/users/atlassian/apps/atlassianstaging/public/wp-content/plugins/curator/template-parts/cards/article-card.php on line 119
Company News
Team ’25 Europe: AI that’s changing the game for teams

More Collections


Warning: Undefined array key “link” in /srv/users/atlassian/apps/atlassianstaging/public/wp-content/plugins/curator/template-parts/cards/article-card.php on line 119

Meet Rovo everywhere: AI that connects every app, every team, every workflow


Warning: Undefined array key “link” in /srv/users/atlassian/apps/atlassianstaging/public/wp-content/plugins/curator/template-parts/cards/article-card.php on line 119

Introducing Atlassian Software Collection


Warning: Undefined array key “link” in /srv/users/atlassian/apps/atlassianstaging/public/wp-content/plugins/curator/template-parts/cards/article-card.php on line 119

Move Faster and Work Smarter with Atlassian’s AI-Powered Teamwork Collection