From 46952ed0aeef53f1625781b416fe8d841738baa9 Mon Sep 17 00:00:00 2001 From: Shay Nehmad Date: Sun, 9 Feb 2020 11:51:00 +0200 Subject: [PATCH] Changed build to static file so that build scripts can change it dynamically --- monkey/common/BUILD | 1 + monkey/common/version.py | 5 ++++- monkey/infection_monkey/monkey.spec | 4 +++- monkey/monkey_island/monkey_island.spec | 4 +++- 4 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 monkey/common/BUILD diff --git a/monkey/common/BUILD b/monkey/common/BUILD new file mode 100644 index 000000000..90012116c --- /dev/null +++ b/monkey/common/BUILD @@ -0,0 +1 @@ +dev \ No newline at end of file diff --git a/monkey/common/version.py b/monkey/common/version.py index 317afe99a..9d60e636c 100644 --- a/monkey/common/version.py +++ b/monkey/common/version.py @@ -1,10 +1,13 @@ # To get the version from shell, run `python ./version.py` (see `python ./version.py -h` for details). import argparse +from pathlib import Path MAJOR = "1" MINOR = "8" PATCH = "0" -BUILD = "dev" +build_file_path = Path(__file__).parent.joinpath("BUILD") +with open(build_file_path, "r") as build_file: + BUILD = build_file.read() def get_version(build=BUILD): diff --git a/monkey/infection_monkey/monkey.spec b/monkey/infection_monkey/monkey.spec index 2157b697c..4baa205e2 100644 --- a/monkey/infection_monkey/monkey.spec +++ b/monkey/infection_monkey/monkey.spec @@ -19,7 +19,9 @@ def main(): hookspath=['./pyinstaller_hooks'], runtime_hooks=None, binaries=None, - datas=None, + datas=[ + ("../common/BUILD", "../common/BUILD") + ], excludes=None, win_no_prefer_redirects=None, win_private_assemblies=None, diff --git a/monkey/monkey_island/monkey_island.spec b/monkey/monkey_island/monkey_island.spec index 342df5ab3..e74763160 100644 --- a/monkey/monkey_island/monkey_island.spec +++ b/monkey/monkey_island/monkey_island.spec @@ -15,7 +15,9 @@ def main(): hookspath=None, runtime_hooks=None, binaries=None, - datas=None, + datas=[ + ("../common/BUILD", "../common/BUILD") + ], excludes=None, win_no_prefer_redirects=None, win_private_assemblies=None,