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 73df327 commit 321a07c
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 @@ -9,11 +9,13 @@ phases:
on-failure: ABORT
commands:
- 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 321a07c

Please sign in to comment.