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 ‘
Company News

Announcing social enterprise discounts: Atlassian tools for social impact teams

Leadership

Great managers meet uncertainty with curiosity and confidence

Company News

Introducing Databricks Query Runner: Transforming data into insight

Company News

Team ’25 Europe: AI that’s changing the game for teams


More Collections

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

Introducing Atlassian Software Collection

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