forked from the-blue-alliance/the-blue-alliance
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.py
44 lines (35 loc) · 1.6 KB
/
deploy.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
"""
To use:
1. Clone a production copy of TBA in the same directory as the development copy by running: `git clone git@github.com:the-blue-alliance/the-blue-alliance.git the-blue-alliance-prod`
2. Ensure APP_CFG_DIR points to the correct location
"""
import argparse
import os
import sys
APP_CFG_DIR = '~/Downloads/google_appengine' # Eugene's Windows
# APP_CFG_DIR = '/usr/local/bin' # Mac OS symlinks made by GoogleAppEngineLauncher
def main():
parser = argparse.ArgumentParser(description='Deploy The Blue Alliance app.')
parser.add_argument('app_cfg_dir', type=str, default=APP_CFG_DIR,
help='path to folder containing appcfg.py')
parser.add_argument('-s', '--skip_tests', action='store_true',
help='Skip running tests. #yolo.')
args = parser.parse_args()
os.chdir('../the-blue-alliance-prod')
os.system('git pull origin master')
test_status = 0
if args.skip_tests:
print "Skipping tests!"
os.system('paver make')
else:
test_status = os.system('paver preflight')
if test_status == 0:
# Update default module and other YAMLs
os.system('python ' + args.app_cfg_dir + '/appcfg.py -A tbatv-prod-hrd update .')
# Update other modules
os.system('python ' + args.app_cfg_dir + '/appcfg.py -A tbatv-prod-hrd update app-backend-tasks.yaml')
os.system('python ' + args.app_cfg_dir + '/appcfg.py -A tbatv-prod-hrd update app-backend-tasks-b2.yaml')
else:
print "Tests failed! Did not deploy."
if __name__ == "__main__":
main()