provision_version: Move to under UUID_VAR_PATH.

This commit is contained in:
Tim Abbott
2017-10-17 20:02:44 -07:00
parent 3983ebce9a
commit 3fed995a41
3 changed files with 7 additions and 3 deletions

View File

@@ -11,6 +11,8 @@ if False:
TOOLS_DIR = os.path.dirname(__file__) TOOLS_DIR = os.path.dirname(__file__)
ROOT_DIR = os.path.dirname(TOOLS_DIR) ROOT_DIR = os.path.dirname(TOOLS_DIR)
sys.path.insert(0, ROOT_DIR) sys.path.insert(0, ROOT_DIR)
from scripts.lib.zulip_tools import get_dev_uuid_var_path
UUID_VAR_PATH = get_dev_uuid_var_path()
def run(check_func): def run(check_func):
# type: (Callable) -> None # type: (Callable) -> None
@@ -70,7 +72,7 @@ def check_django():
@run @run
def provision_version(): def provision_version():
# type: () -> bool # type: () -> bool
fn = os.path.join(ROOT_DIR, 'var/provision_version') fn = os.path.join(UUID_VAR_PATH, 'provision_version')
with open(fn) as f: with open(fn) as f:
version = f.read().strip() version = f.read().strip()
print('latest version provisioned:', version) print('latest version provisioned:', version)

View File

@@ -369,7 +369,7 @@ def main(options):
else: else:
print("No need to run `manage.py compilemessages`.") print("No need to run `manage.py compilemessages`.")
version_file = os.path.join(ZULIP_PATH, 'var/provision_version') version_file = os.path.join(UUID_VAR_PATH, 'provision_version')
print('writing to %s\n' % (version_file,)) print('writing to %s\n' % (version_file,))
open(version_file, 'w').write(PROVISION_VERSION + '\n') open(version_file, 'w').write(PROVISION_VERSION + '\n')

View File

@@ -3,6 +3,7 @@ from typing import Optional, Tuple
import os import os
from distutils.version import LooseVersion from distutils.version import LooseVersion
from version import PROVISION_VERSION from version import PROVISION_VERSION
from scripts.lib.zulip_tools import get_dev_uuid_var_path
def get_major_version(v): def get_major_version(v):
# type: (str) -> int # type: (str) -> int
@@ -10,7 +11,8 @@ def get_major_version(v):
def get_version_file(): def get_version_file():
# type: () -> str # type: () -> str
return 'var/provision_version' uuid_var_path = get_dev_uuid_var_path()
return os.path.join(uuid_var_path, 'provision_version')
PREAMBLE = ''' PREAMBLE = '''
Before we run tests, we make sure your provisioning version Before we run tests, we make sure your provisioning version