Missed Team ’24? Catch up on announcements here.

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

How get deployment enviroment variable in manual step?

zhuravlevVadimir June 14, 2019

Hi, I want to deploy a project in two steps. I have the next configuration for pipeline and set up Deployment env. variable.  In the first step, the variables exist but in the second step(manual) variables doesn't exist. How I can get access to env variables from first step or from Deployment variables and don't use Global Repository variables?
First step:
DeepinScreenshot_select-area_20190615083207.pngSecond step:DeepinScreenshot_select-area_20190615083137.png

pipelines:
default:
- step:
name: Linting
caches:
- node
script:
- npm install
branches:
my_branch:
- step:
name: Build project
deployment: staging
script:
- echo "Auto step, AWS_SECRET_ACCESS_KEY = $AWS_SECRET_ACCESS_KEY"
- echo "Auto step, AWS_ACCESS_KEY_ID = $AWS_ACCESS_KEY_ID"
- npm install
artifacts:
- node_modules/**
- step:
name: Deploy project
trigger: manual
script:
- echo "Manual step, AWS_SECRET_ACCESS_KEY = $AWS_SECRET_ACCESS_KEY"
- echo "Manual step, AWS_ACCESS_KEY_ID = $AWS_ACCESS_KEY_ID"
- npm deploy

 

 

1 answer

1 accepted

1 vote
Answer accepted
Tom Bradshaw
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 16, 2019

Hi Vladimir,

The problem is only the first step has a 'deployment' section. Only steps marked with a 'deployment' section get deployment environment variables.

If you need the variables in both steps, move the 'npm deploy' command into the first step.

If only the deploy step needs the variables move the 'deployment: staging' section to the second step.

If you have any questions let me know.

Cheers,
Tom.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events