From 8e9cb292aefd2dc839ea184c6b0f34e63909a5d2 Mon Sep 17 00:00:00 2001 From: Guohan Lu Date: Sun, 9 Apr 2017 20:23:16 +0000 Subject: [PATCH] [build]: use branch name instead of latest tag for dev build --- functions.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/functions.sh b/functions.sh index 8b2cdb7c50dd..8ca3d5422340 100644 --- a/functions.sh +++ b/functions.sh @@ -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 @@ -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 }