Skip to content

Instantly share code, notes, and snippets.

@igordrnobrega
Created September 22, 2022 14:50
Show Gist options
  • Select an option

  • Save igordrnobrega/3f7745000dce1be6783bacb1c4bfc251 to your computer and use it in GitHub Desktop.

Select an option

Save igordrnobrega/3f7745000dce1be6783bacb1c4bfc251 to your computer and use it in GitHub Desktop.
# Defined in - @ line 1
function login-aws --description 'AWS ECR login for docker'
set profile $argv[1]
set region $argv[2]
set account $AWS_PERSONAL_ACCOUNT_ID
set -e argv[1]
if test "$region" = ""
set region "us-east-1"
end
if test "$profile" = $COMPANY_NAME
echo $COMPANY_NAME "profile"
set account $AWS_COMPANY_ECR_ACCOUNT_ID
end
aws --region $region --profile $profile ecr get-login-password | docker login --username AWS --password-stdin $account.dkr.ecr.$region.amazonaws.com
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment