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

Environment variables for npm scripts

Nick Collins June 25, 2020

I'm trying to pass a variable into my npm script so I can run some pre-deployment methods. Unfortunately the below doesn't work and just throws an error, like the variable doesn't exist (however, it does):

- step:
name: Run Pre-deploy scripts
script:
- MONGODB_URI=$MONGODB_URI npm run preDeploy

 Any help would be greatly appreciated!

1 answer

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 31, 2020

Hi Nick,

Have you defined MONGODB_URI as a repo or a workspace Pipelines variable?

Could you please copy-paste here the full output of this command from the Pipelines log? Please sanitize private/sensitive info in the output, if any.

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events