Skip to content

Commit

Permalink
Merge pull request #702 from osrf/fix_ecr_list
Browse files Browse the repository at this point in the history
Support aws cli 2.0
  • Loading branch information
nkoenig authored Nov 13, 2020
2 parents 8a48787 + 080c1a1 commit 7c44c88
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion subt_ign/scripts/subt_docker_list.bash
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,15 @@ fi

# Log into docker
echo "Logging into docker"
$(aws ecr get-login --no-include-email --region us-east-1)
awsVersion=`aws --version`
if [[ "$awsVersion" == *"aws-cli/1"* ]]; then
$(aws ecr get-login --no-include-email --region us-east-1)
elif [[ "$awsVersion" == *"aws-cli/2"* ]]; then
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 200670743174.dkr.ecr.us-east-1.amazonaws.com
else
echo "Unsupported aws cli version $awsVersion"
exit
fi

if [ $? != 0 ]; then
echo "Failed to log into docker. Check your AWS credentials."
Expand Down

0 comments on commit 7c44c88

Please sign in to comment.