diff options
author | borenet <borenet@chromium.org> | 2016-07-26 11:52:17 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-07-26 11:52:17 -0700 |
commit | 1ed2ae45f59c2864ea05838b4da2750b85472824 (patch) | |
tree | 688a878b16ddb48ae678e8e754c18fe71c23bba0 /infra/bots/upload_skps.py | |
parent | 7e922765545f42ce691e4f3d5fbbd4e44ba47ff1 (diff) |
Move Skia recipes from build repo
BUG=skia:5563
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2175373002
Review-Url: https://codereview.chromium.org/2175373002
Diffstat (limited to 'infra/bots/upload_skps.py')
-rw-r--r-- | infra/bots/upload_skps.py | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/infra/bots/upload_skps.py b/infra/bots/upload_skps.py new file mode 100644 index 0000000000..8d76b801dc --- /dev/null +++ b/infra/bots/upload_skps.py @@ -0,0 +1,59 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""Create a CL to update the SKP version.""" + + +import argparse +import os +import subprocess +import sys + +sys.path.insert(0, os.path.join(os.getcwd(), 'common')) +# pylint:disable=F0401 +from py.utils import git_utils + + + +CHROMIUM_SKIA = 'https://chromium.googlesource.com/skia.git' +COMMIT_MSG = '''Update SKP version + +Automatic commit by the RecreateSKPs bot. + +TBR= +NO_MERGE_BUILDS +''' +SKIA_COMMITTER_EMAIL = 'skia.buildbots@gmail.com' +SKIA_COMMITTER_NAME = 'skia.buildbots' +SKIA_REPO = 'https://skia.googlesource.com/skia.git' + + +def main(target_dir): + subprocess.check_call(['git', 'config', '--local', 'user.name', + SKIA_COMMITTER_NAME]) + subprocess.check_call(['git', 'config', '--local', 'user.email', + SKIA_COMMITTER_EMAIL]) + if CHROMIUM_SKIA in subprocess.check_output(['git', 'remote', '-v']): + subprocess.check_call(['git', 'remote', 'set-url', 'origin', SKIA_REPO, + CHROMIUM_SKIA]) + + # Download CIPD. + cipd_sha1 = os.path.join(os.getcwd(), 'infra', 'bots', 'tools', 'luci-go', + 'linux64', 'cipd.sha1') + subprocess.check_call(['download_from_google_storage', '-s', cipd_sha1, + '--bucket', 'chromium-luci']) + + 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]) + + +if '__main__' == __name__: + parser = argparse.ArgumentParser() + parser.add_argument("--target_dir") + args = parser.parse_args() + main(args.target_dir) |