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,560,334
Community Members
 
Community Events
185
Community Groups

How to access deployment environment variables in more than one step?

Edited

It's possible?

2 answers

it seems odd that his limitation exists.

could this be added as a feature?

our use case is to write client secrets from Deployment Variables into a file, and in the next step run a pipe which requires those variables.

otherwise I need to quit using the pipe, and script this all out.

0 votes
StannousBaratheon
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 02, 2019

Hi @Danilo Gentil Setúbal 

An environment can only be deployed to from one step in the pipeline.

You can define the same variable on different environments however and each step will get the value associated with the environment it deploys to.

You can also define account and repository level variables that are available to every step in the pipeline.

For example if you define:

  • A repository level variable: MY_VAR with value my_repo_var
  • A deployment variable on the Test environment: MY_VAR with value my_test_var
  • A deployment variable on the Production environment: MY_VAR with value my_prod_var

Then this pipeline:

pipelines:
default:
- step:
script:
- echo $MY_VAR
- step:
deployment: test
script:
- echo $MY_VAR
- step:
deployment: production
script:
- echo $MY_VAR
- step:
script:
- echo $MY_VAR

will produce the following output:

my_repo_var

my_test_var

my_prod_var

my_repo_var

Please see the following page in our documentation for more information on variables: https://confluence.atlassian.com/bitbucket/variables-in-pipelines-794502608.html

Hi 

I have 20 lambdas to deploy, each gets deployed only when there is a change in corresponding code( I am using condition, changesets-include paths to build the corresponding lambda). My concerns is can I specify "deployment: Dev" as 20 times, I mean each step?. Please suggest 

@StannousBaratheon so, if we divide our deployment into two steps, one is build the application, and other is deploy, and we want a manual approval/click prior second step; and both use same variables from the same deployment (i.e. development, as distinct from staging and production) - this is not possible, right?

can we use manual approval in the middle of a single step?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events