#!/bin/bash # Logs in the local docker to ECR so it can push and pull images. # Works for both aws cli versions (1 and 2 ) IS_V2=`aws --version | grep -P "^aws-cli/2" | wc -l` if [[ $IS_V2 -eq "1" ]]; then aws ecr get-login-password --region eu-west-1 --profile personal | docker login --username AWS --password-stdin 299952237278.dkr.ecr.eu-west-1.amazonaws.com else $(aws ecr get-login --no-include-email --region eu-west-1 --profile personal) fi