9"""Create the asset and upload it."""
20FILE_DIR = os.path.dirname(os.path.abspath(__file__))
21ASSET = os.path.basename(FILE_DIR)
25 parser = argparse.ArgumentParser()
26 parser.add_argument(
'--chrome_src_path',
'-c', required=
True)
27 parser.add_argument(
'--browser_executable',
'-e', required=
True)
28 parser.add_argument(
'--dm_path',
'-d', required=
True)
29 parser.add_argument(
'--upload_to_partner_bucket', action=
'store_true')
30 parser.add_argument(
'--dry_run', action=
'store_true')
31 parser.add_argument(
'--local', action=
'store_true')
32 args = parser.parse_args()
35 os.environ[create.BROWSER_EXECUTABLE_ENV_VAR] = args.browser_executable
36 os.environ[create.CHROME_SRC_PATH_ENV_VAR] = args.chrome_src_path
37 os.environ[create.UPLOAD_TO_PARTNER_BUCKET_ENV_VAR] = (
38 '1' if args.upload_to_partner_bucket
else '0')
39 os.environ[create.DM_PATH_ENV_VAR] = args.dm_path
41 sk = os.path.realpath(os.path.join(
42 FILE_DIR, os.pardir, os.pardir, os.pardir, os.pardir,
'bin',
'sk'))
45 if not os.path.isfile(sk):
46 raise Exception(
'`sk` not found at %s; maybe you need to run bin/fetch-sk?')
49 chromium_revision = subprocess.check_output(
50 [
'git',
'rev-parse',
'HEAD'], cwd=args.chrome_src_path).
decode().rstrip()
54 sk,
'asset',
'upload',
55 '--tags',
'chromium_revision:%s' % chromium_revision,
58 cmd.append(
'--dry-run')
62 subprocess.check_call(cmd, cwd=FILE_DIR)
65if __name__ ==
'__main__':
static DecodeResult decode(std::string path)