Skip to content

Commit 9b249ce

Browse files
andriymoroz-mlnxlguohan
authored andcommitted
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
1 parent 0db8704 commit 9b249ce

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

functions.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ sonic_get_version() {
5555
local latest_tag=$(git describe --tags --abbrev=0)
5656
local branch_name=$(git rev-parse --abbrev-ref HEAD)
5757
if [ -n "$(git status --untracked-files=no -s --ignore-submodules)" ]; then
58-
local dirty="-dirty"
58+
local dirty="-dirty-$DIRTY_SUFFIX"
5959
fi
6060
BUILD_NUMBER=${BUILD_NUMBER:-0}
6161
## Check if we are on tagged commit

slave.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,8 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : .platform
423423
chmod +x sonic_debian_extension.sh,
424424
)
425425

426+
DIRTY_SUFFIX="$(shell date +%Y%m%d\.%H%M%S)"
427+
export DIRTY_SUFFIX
426428
./build_debian.sh "$(USERNAME)" "$(shell perl -e 'print crypt("$(PASSWORD)", "salt"),"\n"')" $(LOG)
427429
TARGET_MACHINE=$($*_MACHINE) IMAGE_TYPE=$($*_IMAGE_TYPE) ./build_image.sh $(LOG)
428430

0 commit comments

Comments
 (0)