Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

YAML anchors + Overriding + Reusing deployment variables


So here is a doozy

  1. For some reason bitbucket does not allow us to use the deployment variables for more than on step.
  2. To get around this we are passing in variables through the use of artifacts to the next step.
  3. As one of those variables is an AWS Key we obviously don't want to pass that off as an artifact to leave out in the open.
  4. To get around this we are creating a separate AWS variable at the repo level for each environment.

The problem is if you are reusing steps vs YAML anchors (say s3 deploy pipe), how would you get the right AWS variable to be called in the reused pipes? Sample code below. So say I have different keys for Dev and UAT

- step: &build-and-deploy
name: Build And Deploy
- pipe: atlassian/aws-s3-deploy:0.2.4
- step: *build-and-deploy
- step: *build-and-deploy




2 answers

@Ming Han Chung I have the same issue. I want to reuse codedeploy pipe and replace the value of DEPLOYMENT_GROUP.

- step: *build
- step:
<<: *deploy
name: Deploy to Prod
deployment: production
trigger: manual
DEPLOYMENT_GROUP: 'production-deployment-group'

@Abryan Manalansang  did you get a solution to this?

likewise! This would save me a lot of effort

did this work for you?

There a possible hacky solution here:

Basically use a step that writes env vars to a file and pass that around... 

Suggest an answer

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

Git push size limits are coming to Bitbucket Cloud starting April 4th, 2022

Beginning on April 4th, we will be implementing push limits. This means that your push cannot be completed if it is over 3.5 GB. If you do attempt to complete a push that is over 3.5 GB, it will fail...

3,487 views 3 10
Read article

Atlassian Community Events