Build: Change BUILD file to include commit hash on dev builds

Issue #1553
This commit is contained in:
Ilija Lazoroski 2022-04-27 17:18:26 +02:00 committed by Mike Salvatore
parent f65e009db6
commit 0a145be25d
3 changed files with 11 additions and 2 deletions

View File

@ -71,6 +71,7 @@ Changelog](https://keepachangelog.com/en/1.0.0/).
- The /api/t1216-pba/download endpoint. #1864 - The /api/t1216-pba/download endpoint. #1864
- Island log download button from "Telemetries"(previously called "Logs") page. #1640 - Island log download button from "Telemetries"(previously called "Logs") page. #1640
- "/api/client-monkey" endpoint. #1889 - "/api/client-monkey" endpoint. #1889
- "+dev" from version numbers. #1553
### Fixed ### Fixed
- A bug in network map page that caused delay of telemetry log loading. #1545 - A bug in network map page that caused delay of telemetry log loading. #1545

View File

@ -196,14 +196,19 @@ fi
install_build_prereqs install_build_prereqs
install_package_specific_build_prereqs "$WORKSPACE" install_package_specific_build_prereqs "$WORKSPACE"
commit_id=$(get_commit_id "$monkey_repo")
is_release_build=false is_release_build=false
# Monkey version is empty on release build # Monkey version is empty on release build
if [ ! -z "$monkey_version" ]; then if [ ! -z "$monkey_version" ]; then
is_release_build=true is_release_build=true
echo -n "" > "$monkey_repo/monkey/common/BUILD"
else
echo $commit_id > "$monkey_repo/monkey/common/BUILD"
fi fi
setup_build_dir "$agent_binary_dir" "$monkey_repo" "$deployment_type" "$is_release_build" 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" build_package "$monkey_version" "$commit_id" "$DIST_DIR"
log_message "Finished building package: $package" log_message "Finished building package: $package"

View File

@ -13,7 +13,10 @@ with open(build_file_path, "r") as build_file:
def get_version(build=BUILD): def get_version(build=BUILD):
if build:
return f"{MAJOR}.{MINOR}.{PATCH}+{build}" return f"{MAJOR}.{MINOR}.{PATCH}+{build}"
else:
return f"{MAJOR}.{MINOR}.{PATCH}"
def print_version(): def print_version():