OLD | NEW |
---|---|
(Empty) | |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | |
2 # Use of this source code is governed by a BSD-style license that can be | |
3 # found in the LICENSE file. | |
4 | |
5 """Create a CL to update the SKP version.""" | |
6 | |
7 | |
8 import argparse | |
9 import os | |
10 import subprocess | |
11 import sys | |
12 | |
13 sys.path.insert(0, os.path.join(os.getcwd(), 'common')) | |
14 # pylint:disable=F0401 | |
15 from py.utils import git_utils | |
16 | |
17 | |
18 | |
19 CHROMIUM_SKIA = 'https://chromium.googlesource.com/skia.git' | |
20 COMMIT_MSG = '''Update SKP version | |
21 | |
22 Automatic commit by the RecreateSKPs bot. | |
23 | |
24 TBR= | |
25 NO_MERGE_BUILDS | |
26 ''' | |
27 SKIA_COMMITTER_EMAIL = 'skia.buildbots@gmail.com' | |
28 SKIA_COMMITTER_NAME = 'skia.buildbots' | |
29 SKIA_REPO = 'https://skia.googlesource.com/skia.git' | |
30 | |
31 | |
32 def main(target_dir): | |
33 subprocess.check_call(['git', 'config', '--local', 'user.name', | |
34 SKIA_COMMITTER_NAME]) | |
35 subprocess.check_call(['git', 'config', '--local', 'user.email', | |
36 SKIA_COMMITTER_EMAIL]) | |
37 if CHROMIUM_SKIA in subprocess.check_output(['git', 'remote', '-v']): | |
38 subprocess.check_call(['git', 'remote', 'set-url', 'origin', SKIA_REPO, | |
39 CHROMIUM_SKIA]) | |
40 | |
41 # Download CIPD. | |
42 cipd_sha1 = os.path.join(os.getcwd(), 'infra', 'bots', 'tools', 'luci-go', | |
43 'linux64', 'cipd.sha1') | |
44 subprocess.check_call(['download_from_google_storage', '-s', cipd_sha1, | |
45 '--bucket', 'chromium-luci']) | |
46 | |
47 with git_utils.GitBranch(branch_name='update_skp_version', | |
48 commit_msg=COMMIT_MSG, | |
49 commit_queue=True): | |
50 upload_script = os.path.join( | |
51 os.getcwd(), 'infra', 'bots', 'assets', 'skp', 'upload.py') | |
52 subprocess.check_call(['python', upload_script, '-t', target_dir]) | |
53 | |
54 # TODO(borenet): Upload to partner GS bucket? | |
rmistry
2016/07/26 18:20:03
Remove TODO.
borenet
2016/07/26 18:29:31
Done.
| |
55 | |
56 | |
57 if '__main__' == __name__: | |
58 parser = argparse.ArgumentParser() | |
59 parser.add_argument("--target_dir") | |
60 args = parser.parse_args() | |
61 main(args.target_dir) | |
OLD | NEW |