Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal


  • Give kudos
  • Received
  • Given


  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

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

Is it possible to set environment variables per pipeline step

To keep my pipeline tasks DRY I want to reuse my deployment task.  I now have something like:

- step:
deployment: test
- step:
deployment: staging
trigger: manual

But the DEPLOY_STAGING and DEPLOY_TEST definitions only differ regarding the env on which to deploy.  Can I add something like:

- step:
deployment: test
HOST: test-host

To further reuse code and have just one DEPLOY definition?

1 answer

1 accepted

0 votes
Answer accepted

Hi Rutger,

We recently released support for defining Deployment Variables. This will allow you to configure variables that will be injected into the relevant Deployment Step. Which seems to be what you need here.

You can configure them in the Repository Settings -> Pipelines -> Deployments.



Too bad we are only restricted to three hardcoded deployments though

@Liri Sokol, we've started work on adding support for flexible environment configurations (i.e. more than 3 environments, named whatever you want). You can follow its progress here:

Also it's not just deployment where different environment vars may be needed; e.g.  separate smoke test steps for an env that should be run after a deploy to that env

Suggest an answer

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

Calling any interview participants for Bitbucket Data Center

Hi everyone,  We are looking to learn more about development teams’ workflows and pain points, especially around DevOps, integrations, administration, scale, security, and the related challeng...

464 views 4 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