Add time stamp suffix to the dirty images version string (#958)

* Add timestamp suffix to the dirty images version string

This will allow to build different debug images without
having to update BUILD_NUMBER variable before the build

* Changed timestamp format to YYYYMMDD.HHMMSS
This commit is contained in:
Andriy Moroz 2017-09-27 10:04:34 +03:00 committed by lguohan
parent 0db8704754
commit 9b249ceb59
2 changed files with 3 additions and 1 deletions

View File

@ -55,7 +55,7 @@ sonic_get_version() {
local latest_tag=$(git describe --tags --abbrev=0) local latest_tag=$(git describe --tags --abbrev=0)
local branch_name=$(git rev-parse --abbrev-ref HEAD) local branch_name=$(git rev-parse --abbrev-ref HEAD)
if [ -n "$(git status --untracked-files=no -s --ignore-submodules)" ]; then if [ -n "$(git status --untracked-files=no -s --ignore-submodules)" ]; then
local dirty="-dirty" local dirty="-dirty-$DIRTY_SUFFIX"
fi fi
BUILD_NUMBER=${BUILD_NUMBER:-0} BUILD_NUMBER=${BUILD_NUMBER:-0}
## Check if we are on tagged commit ## Check if we are on tagged commit

View File

@ -423,6 +423,8 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : .platform
chmod +x sonic_debian_extension.sh, chmod +x sonic_debian_extension.sh,
) )
DIRTY_SUFFIX="$(shell date +%Y%m%d\.%H%M%S)"
export DIRTY_SUFFIX
./build_debian.sh "$(USERNAME)" "$(shell perl -e 'print crypt("$(PASSWORD)", "salt"),"\n"')" $(LOG) ./build_debian.sh "$(USERNAME)" "$(shell perl -e 'print crypt("$(PASSWORD)", "salt"),"\n"')" $(LOG)
TARGET_MACHINE=$($*_MACHINE) IMAGE_TYPE=$($*_IMAGE_TYPE) ./build_image.sh $(LOG) TARGET_MACHINE=$($*_MACHINE) IMAGE_TYPE=$($*_IMAGE_TYPE) ./build_image.sh $(LOG)