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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

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
4,463,408
Community Members
 
Community Events
176
Community Groups

Deployment variables not working with multiple staging

I have a deployment pipeline I'm trying to configure, and within the pipeline I have multiple deployment steps for various parts of the staging environment.

I have configured the repository settings to group these deployments under Staging:

"Staging-step-1"
"Staging-step-2"

In my pipeline, I've configured some variables at the Repository level, and some additional Deployment specific variables at the Staging level. However, when I try and run the pipeline, the Staging Deployment variables are empty. Here's an example step:

 - step:
name: Build and deploy Lambda image on Staging
deployment: Staging-step-1
trigger: manual
size: 2x
services:
- docker
script:
- echo "Building container image"
- docker build --build-arg SHA=$BITBUCKET_COMMIT -t $MY_IMAGE_NAME .
- pipe: atlassian/aws-ecr-push-image:1.4.2
variables:
IMAGE_NAME: ${MY_IMAGE_NAME}
AWS_DEFAULT_REGION: ${AWS_DEFAULT_REGION}
AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID}
AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY}
- pipe: atlassian/aws-lambda-deploy:1.1.0
variables:
AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID}
AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY}
FUNCTION_NAME: ${MY_FUNCTION_NAME}
COMMAND: 'update'
IMAGE_URI: '${AWS_ACCOUNT_ID}.dkr.ecr.eu-west-2.amazonaws.com/${MY_IMAGE_NAME}:latest' 

In the above, all of the AWS variables are defined for the Repository, and they are set correctly. The rest of the variables (eg. MY_IMAGE_NAME) are set at the Staging Deployment level, and they come in blank.

What am I missing here?

1 answer

1 accepted

0 votes
Answer accepted

Hi Greg and welcome to the community!

You mention the following:

I have configured the repository settings to group these deployments under Staging:

"Staging-step-1"
"Staging-step-2"

Could you please clarify if you have created additional deployment environments with the names Staging-step-1, Staging-step-2? If so, are the deployment variables defined for these environments?

For the example you included in your post, the variable MY_IMAGE_NAME will need to be defined for the environment with the name Staging-step-1.

Based on your description, it sounds that you may have defined the variable for the environment named Staging only, which would explain why the variables are empty. Even if you create multiple staging environments, each of them is separate and cannot read variables set for a different staging environment.

I would suggest double-checking if the rest of the variables are set for the deployment environments where you're using them, e.g. Staging-step-1, Staging-step-2, and if not, define them there. Please feel free to let me know if this helps or if you're still facing issues.

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events