Skip to content

Commit

Permalink
Build: Change BUILD file to include commit hash on dev builds
Browse files Browse the repository at this point in the history
Issue #1553
  • Loading branch information
ilija-lazoroski authored and mssalvatore committed Apr 29, 2022
1 parent f65e009 commit 0a145be
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ Changelog](https://keepachangelog.com/en/1.0.0/).
- The /api/t1216-pba/download endpoint. #1864
- Island log download button from "Telemetries"(previously called "Logs") page. #1640
- "/api/client-monkey" endpoint. #1889
- "+dev" from version numbers. #1553

### Fixed
- A bug in network map page that caused delay of telemetry log loading. #1545
Expand Down
7 changes: 6 additions & 1 deletion build_scripts/build_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -196,14 +196,19 @@ fi
install_build_prereqs
install_package_specific_build_prereqs "$WORKSPACE"

commit_id=$(get_commit_id "$monkey_repo")

is_release_build=false
# Monkey version is empty on release build
if [ ! -z "$monkey_version" ]; then
is_release_build=true
echo -n "" > "$monkey_repo/monkey/common/BUILD"
else
echo $commit_id > "$monkey_repo/monkey/common/BUILD"
fi

setup_build_dir "$agent_binary_dir" "$monkey_repo" "$deployment_type" "$is_release_build"
commit_id=$(get_commit_id "$monkey_repo")

build_package "$monkey_version" "$commit_id" "$DIST_DIR"

log_message "Finished building package: $package"
Expand Down
5 changes: 4 additions & 1 deletion monkey/common/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@


def get_version(build=BUILD):
return f"{MAJOR}.{MINOR}.{PATCH}+{build}"
if build:
return f"{MAJOR}.{MINOR}.{PATCH}+{build}"
else:
return f"{MAJOR}.{MINOR}.{PATCH}"


def print_version():
Expand Down

0 comments on commit 0a145be

Please sign in to comment.