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:
Second step:
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.