Skip to content

Commit

Permalink
Add time stamp suffix to the dirty images version string (#958)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
andriymoroz-mlnx authored and lguohan committed Sep 27, 2017
1 parent 0db8704 commit 9b249ce
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ sonic_get_version() {
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"
local dirty="-dirty-$DIRTY_SUFFIX"
fi
BUILD_NUMBER=${BUILD_NUMBER:-0}
## Check if we are on tagged commit
Expand Down
2 changes: 2 additions & 0 deletions slave.mk
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,8 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : .platform
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)
TARGET_MACHINE=$($*_MACHINE) IMAGE_TYPE=$($*_IMAGE_TYPE) ./build_image.sh $(LOG)

Expand Down

0 comments on commit 9b249ce

Please sign in to comment.