The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How get deployment enviroment variable in manual step?

zhuravlevVadimir
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

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.

TAGS
AUG Leaders

Atlassian Community Events