upgrade: Don't require authors updates deploying from Git.

Fixes #3392.
This commit is contained in:
Tim Abbott
2017-01-23 22:19:25 -08:00
parent 4e171ce787
commit 126b1c4edc
3 changed files with 8 additions and 2 deletions

View File

@@ -70,7 +70,7 @@ if args.from_git:
# update-prod-static with the git upgrade process. But it'll fail
# safely; this seems like a worthwhile tradeoff to minimize downtime.
logging.info("Building static assets...")
subprocess.check_call(["./tools/update-prod-static", "--prev-deploy",
subprocess.check_call(["./tools/update-prod-static", "--authors-not-required", "--prev-deploy",
os.path.join(DEPLOYMENTS_DIR, 'current')],
preexec_fn=su_to_zulip)
else:

View File

@@ -32,6 +32,8 @@ parser.add_argument('--max-retries', type=int, default=3,
# fetching from Github constantly.
parser.add_argument('--use-fixture', action='store_true', default=False,
help='Use fixture data instead of fetching from Github')
parser.add_argument('--not-required', action='store_true', default=False,
help='Consider failures to reach GitHub nonfatal')
args = parser.parse_args()
def fetch_data(retries, link):
@@ -88,7 +90,7 @@ def run_production():
write_to_disk(out_data, settings.CONTRIBUTORS_DATA)
else:
elif not args.not_required:
print('Fail to fetch data from Github.')
sys.exit(1)

View File

@@ -19,6 +19,8 @@ from scripts.lib.node_cache import setup_node_modules
parser = argparse.ArgumentParser()
parser.add_argument('--prev-deploy', metavar='DIR',
help='a previous deploy from which to reuse files if possible')
parser.add_argument('--authors-not-required', action='store_true', default=False,
help='Authors files need not be updated')
args = parser.parse_args()
prev_deploy = args.prev_deploy
@@ -68,6 +70,8 @@ subprocess.check_call(['cp', '-a', 'static/locale',
authors_cmd = ['./tools/update-authors-json']
if os.environ.get("TRAVIS"):
authors_cmd.append("--use-fixture")
if args.authors_not_required:
authors_cmd.append("--not-required")
subprocess.check_call(authors_cmd, stdout=fp)
fp.close()