yage
531aa52146
===================================================================== --- Changes ------------------------------ - Introduced lazy environment variable checking on ECR_LOGIN
28 lines
653 B
Bash
28 lines
653 B
Bash
#####################################################################
|
|
|
|
DEPENDENCIES+=(
|
|
docker
|
|
)
|
|
|
|
REQUIRED_ENV+=()
|
|
|
|
use cloud/aws/cli
|
|
|
|
#####################################################################
|
|
|
|
ECR_LOGIN() {
|
|
REQUIRED_ENV=(AWS_REGION AWS_ACCOUNT) CHECK_ENVIRONMENT || return 1
|
|
|
|
STATUS "performing AWS ECR docker login"
|
|
AWS ecr get-login-password \
|
|
| docker login \
|
|
--username AWS \
|
|
--password-stdin \
|
|
"$AWS_ACCOUNT.dkr.ecr.$AWS_REGION.amazonaws.com" \
|
|
&& SUCCESS "authenticated docker for '$AWS_ACCOUNT' in '$AWS_REGION'" \
|
|
|| {
|
|
ERROR "unable to authenticate docker for '$AWS_ACCOUNT' in '$AWS_REGION'"
|
|
return 1
|
|
}
|
|
}
|