I'm pulling image into my pipeline from ECR. First I need to authenticate using
eval $(aws ecr get-login --region eu-west-2 --no-include-email | sed 's|https://||')
however I don't have an idea how to use it within CI workflow since this should run
before the image is pulled:
e2e:
stage: test
image: 2xxxxxxxxxxxxx8.dkr.ecr.eu-west-2.amazonaws.com/training-users_db
services:
- postgres:12.2-alpine
variables:
AWS_ACCOUNT_ID: $AWS_ACCOUNT_ID
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_KEY: $AWS_SECRET_ACCESS_KEY
POSTGRES_DB: users
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
DATABASE_TEST_URL: postgres://postgres:postgres@postgres:5432/users
FLASK_ENV: development
SECRET_KEY: $SECRET_KEY
script:
- eval $(aws ecr get-login --region eu-west-2 --no-include-email | sed 's|https://||')
How can I log into ECR right before the image is pulled ?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…