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

Default variables in deployment steps

Jason Ausmus April 23, 2021

Hello,

I recently tried to set the `$BITBUCKET_BRANCH` default variable for the deployment key in my yaml. I got an error when the pipeline ran stating:

"The environment '$BITBUCKET_BRANCH' in your bitbucket-pipelines.yml doesn’t match any environment defined in your settings. Either update your yml, or your settings, to use the same name."

Here's an example of what I'm talking about:

- step: &terraform_update
    image: name: <image>
  name: Update Terraform
  deployment: $BITBUCKET_BRANCH
  script:
      -
do stuff

I have deployment variables set for each environment. Do deployment variables override default variables like $BITBUCKET_BRANCH even if they're not overwritten in the deployment variables?

 

 

1 answer

0 votes
Justin Thomas
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 4, 2021

@Jason Ausmus Bitbucket Pipelines doesn't support using variables as key for deployment, you will have to statically define the deployment environment.

step&terraform_update
    image: name<image>
  nameUpdate Terraform
  deploymentprod-deploy
  script:
      - 
do stuff

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events