Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
tag fix change to prefix prod or dev string
tag fix change to prefix prod or dev string. We are adding addtional tag
with the prefix existing tags will remain same.
  • Loading branch information
pandurangpatil committed May 22, 2025
commit 24db6459e945485214373f2845ec25c776ceedc0
14 changes: 8 additions & 6 deletions buildspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@ phases:
if [[ $AWS_REGION = "eu-west-1" ]]
then
TAG_1=latest
TAG_PREFIX="prod"
else
TAG_1=${CODEBUILD_WEBHOOK_TRIGGER:7}
TAG_1=${CODEBUILD_WEBHOOK_HEAD_REF##*/}
# assigns branch name for dev build it will be dev
TAG_PREFIX=TAG_1
fi
- TAG_2=$VERSION
- TAG_3=${CODEBUILD_WEBHOOK_HEAD_REF##*/}

build:
commands:
Expand All @@ -51,11 +53,11 @@ phases:
- docker push $REPOSITORY_URI:$TAG_1
- docker push $REPOSITORY_URI:$TAG_2
- |
if [[ -z "$TAG_3" ]]
if [[ -z "$TAG_PREFIX" ]]
then
echo "\$TAG_3 is empty"
echo "\$TAG_PREFIX is empty"
else
docker tag $REPOSITORY_URI:latest $REPOSITORY_URI:$TAG_3-$VERSION
docker push $REPOSITORY_URI:$TAG_3-$VERSION
docker tag $REPOSITORY_URI:latest $REPOSITORY_URI:$TAG_PREFIX-$VERSION
docker push $REPOSITORY_URI:$TAG_PREFIX-$VERSION
fi
- echo completed pushing image to ecr
Loading