I have a script that updates keys for docker login.
How do I get an updated copy of the environment variables in between steps?
bitbucket-pipelines.yml
image: node:8.2.1
pipelines:
default:
- step:
name: Update Docker Password for Login
script:
- npm install aws-sdk request-promise base-64
- node build-tools/update-bb-aws-docker-login.js
- step:
name: Push Server to AWS Repository
script:
- docker login -u AWS -p $AWS_DOCKER_LOGIN https://$AWS_DOCKER_URL
- docker build -t dev .
- docker tag dev:latest $AWS_DOCKER_URL/dev:latest
- docker push $AWS_DOCKER_URL/dev:latest
options:
docker: true
Environment Variables are not carried across steps. They are always copied from those set in the Pipelines UI. If you'd like to update them you can use the Bitbucket Pipelines REST API to do so. Alternatively you can combine the two steps so that the new credentials are available in the push step.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.