-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
eae0493
commit ab252b6
Showing
7 changed files
with
34 additions
and
10 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,26 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
set -o pipefail | ||
|
||
aws ecr get-login-password --region $AWS_REGION | docker login --username AWS --password-stdin $AWS_ECR_REGISTRY_URI | ||
|
||
# AWS_ECR_REPOSITORY_NAME | ||
|
||
latest_commit=$(git rev-parse HEAD) | ||
|
||
# Get the current branch name (optional) | ||
current_branch=$(git rev-parse --abbrev-ref HEAD) | ||
|
||
# Generate the Docker image tag by combining the version and the latest commit hash | ||
image_tag="${AWS_ECR_REPOSITORY_NAME}:${current_branch}-${latest_commit}" | ||
|
||
sudo docker build --no-cache -t $image_tag . | ||
|
||
image_uri="${AWS_ECR_REGISTRY_URI}/${image_tag}" | ||
|
||
sudo docker tag $image_tag $image_uri | ||
|
||
sudo docker push $image_uri | ||
|
||
echo $image_uri |
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
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
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