aboutsummaryrefslogtreecommitdiffhomepage
path: root/infra/bots/upload_skps.py
diff options
context:
space:
mode:
authorGravatar borenet <borenet@chromium.org>2016-10-18 05:20:26 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-10-18 05:20:26 -0700
commit8a91da945929b08bfa916595cd1b70fd4341e007 (patch)
treed48fe4f4b59d238eb63e5cdf9aff928cd1f2696a /infra/bots/upload_skps.py
parent311742bd0eac6fad150bf8f0a4e2809679464e47 (diff)
Fix SKP version in tasks.json, make upload_skps.py update tasks.json
Diffstat (limited to 'infra/bots/upload_skps.py')
-rw-r--r--infra/bots/upload_skps.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/infra/bots/upload_skps.py b/infra/bots/upload_skps.py
index 8d76b801dc..2193f343fc 100644
--- a/infra/bots/upload_skps.py
+++ b/infra/bots/upload_skps.py
@@ -44,12 +44,25 @@ def main(target_dir):
subprocess.check_call(['download_from_google_storage', '-s', cipd_sha1,
'--bucket', 'chromium-luci'])
+ # First verify that there are no gen_tasks diffs.
+ gen_tasks = os.path.join(os.getcwd(), 'infra', 'bots', 'gen_tasks.go')
+ try:
+ subprocess.check_call(['go', 'run', gen_tasks, '--test'])
+ except subprocess.CalledProcessError as e:
+ print >> sys.stderr, ('gen_tasks.go failed, not uploading SKP update:\n\n%s'
+ % e.output)
+ sys.exit(1)
+
+ # Upload the new version, land the update CL.
with git_utils.GitBranch(branch_name='update_skp_version',
commit_msg=COMMIT_MSG,
commit_queue=True):
upload_script = os.path.join(
os.getcwd(), 'infra', 'bots', 'assets', 'skp', 'upload.py')
subprocess.check_call(['python', upload_script, '-t', target_dir])
+ subprocess.check_call(['go', 'run', gen_tasks])
+ subprocess.check_call([
+ 'git', 'add', os.path.join('infra', 'bots', 'tasks.json')])
if '__main__' == __name__: