-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: arcolife <[email protected]>
- Loading branch information
Showing
3 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
|
||
aws_env() { | ||
push_fn "Check AWS CLI access for ${ECR_RESOURCE}" | ||
|
||
AWS_ACCESS_KEY_ID=$(aws configure get aws_access_key_id --profile ${AWS_PROFILE}) | ||
AWS_SECRET_ACCESS_KEY=$(aws configure get aws_secret_access_key --profile ${AWS_PROFILE}) | ||
|
||
ECR_USER=AWS | ||
ECR_REGION=$(aws configure get region --profile ${AWS_PROFILE}) | ||
|
||
export ECR_RESOURCE=${AWS_ACCOUNT}.dkr.ecr.${ECR_REGION}.amazonaws.com | ||
|
||
pop_fn | ||
} | ||
|
||
ecr_login() { | ||
# exported variables used: | ||
# AWS_PROFILE | ||
# AWS_ACCOUNT | ||
|
||
aws_env | ||
|
||
push_fn "Login to AWS ECR ${ECR_RESOURCE}" | ||
|
||
aws ecr get-login-password --region ${ECR_REGION} | \ | ||
$CONTAINER_CLI login --username ${ECR_USER} --password-stdin ${ECR_RESOURCE} | ||
|
||
pop_fn | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters