Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(707)

Side by Side Diff: infra/bots/assets/scripts/create_and_upload.py

Issue 2069543002: Add asset management scripts (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add asset_utils_test Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « infra/bots/assets/scripts/create.py ('k') | infra/bots/assets/scripts/download.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/usr/bin/env python
2 #
3 # Copyright 2016 Google Inc.
4 #
5 # Use of this source code is governed by a BSD-style license that can be
6 # found in the LICENSE file.
7
8
9 """Create the asset and upload it."""
10
11
12 import argparse
13 import common
14 import os
15 import subprocess
16 import sys
17 import utils
18
19
20 def main():
21 parser = argparse.ArgumentParser()
22 parser.add_argument('--gsutil')
23 args = parser.parse_args()
24
25 with utils.tmp_dir():
26 cwd = os.getcwd()
27 create_script = os.path.join(common.FILE_DIR, 'create.py')
28 upload_script = os.path.join(common.FILE_DIR, 'upload.py')
29
30 try:
31 subprocess.check_call(['python', create_script, '-t', cwd])
32 cmd = ['python', upload_script, '-t', cwd]
33 if args.gsutil:
34 cmd.extend(['--gsutil', args.gsutil])
35 subprocess.check_call(cmd)
36 except subprocess.CalledProcessError:
37 # Trap exceptions to avoid printing two stacktraces.
38 sys.exit(1)
39
40
41 if __name__ == '__main__':
42 main()
OLDNEW
« no previous file with comments | « infra/bots/assets/scripts/create.py ('k') | infra/bots/assets/scripts/download.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698