Files
fdn2/scripts/aws-login.sh
T
2023-06-27 00:35:40 +02:00

12 lines
441 B
Bash
Executable File

#!/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 --profile personal)
fi