I have a script that updates keys for docker login.
- If I do NOT run the script that updates keys the in a step, the docker login works perfectly.
- If I run the update keys script on my local machine, the script works, and the docker login works
- If I run the update keys in the pipeline build, the script works but the docker login does NOT work (because the environment variables are not being updated)
- The update keys script needs to run before my 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