Skip to content

Commit

Permalink
[build]: use branch name instead of latest tag for dev build (#490)
Browse files Browse the repository at this point in the history
  • Loading branch information
lguohan authored and marian-pritsak committed Apr 10, 2017
1 parent 1458e9e commit fcc9c84
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ docker_try_rmi() {
sonic_get_version() {
local describe=$(git describe --tags)
local latest_tag=$(git describe --tags --abbrev=0)
local branch_name=$(git rev-parse --abbrev-ref HEAD)
if [ -n "$(git status --untracked-files=no -s --ignore-submodules)" ]; then
local dirty="-dirty"
fi
Expand All @@ -61,6 +62,6 @@ sonic_get_version() {
if [ "$describe" == "$latest_tag" ]; then
echo "${latest_tag}${dirty}"
else
echo "${latest_tag}.${BUILD_NUMBER}${dirty:--$(git rev-parse --short HEAD)}"
echo "${branch_name}.${BUILD_NUMBER}${dirty:--$(git rev-parse --short HEAD)}"
fi
}

0 comments on commit fcc9c84

Please sign in to comment.