Skip to content

Commit

Permalink
tag determination
Browse files Browse the repository at this point in the history
  • Loading branch information
terrywbrady committed Sep 13, 2024
1 parent a0407f0 commit 5b866ce
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions buildspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ phases:
- aws ecr get-login-password --region $AWS_REGION | docker login --username AWS --password-stdin ${ECR_REGISTRY}

- COMMIT=`git rev-parse --short HEAD`
- TAG=`git describe --tags --exact-match 2> /dev/null || echo ''`
- # Get semantic tags for commit otherwise get all tags for commit, sort and choose the last value
- TAG=`(git tag --contains $COMMIT | egrep "^\d+\.\d+\.\d+$" || git tag --contains $COMMIT || echo '') | sort | tail -1`
- |
if [[ "$MODE" == "OnPush" ]]
then
BRANCHTAG=`git describe --tags --exact-match 2> /dev/null || git symbolic-ref -q --short HEAD || git name-rev $(git rev-parse --short HEAD) | cut -d' ' -f2 || git rev-parse --short HEAD`
# Get Tag || Get Branch || Alternate Branch Lookup || Get Committ
BRANCHTAG=`echo $TAG | grep . || git symbolic-ref -q --short HEAD || git name-rev $(git rev-parse --short HEAD) | cut -d' ' -f2 || git rev-parse --short HEAD`
else
BRANCHTAG=$BRANCHNAME
fi
Expand Down

0 comments on commit 5b866ce

Please sign in to comment.