18FILE_DIR = os.path.dirname(os.path.abspath(__file__))
19INFRA_BOTS_DIR = os.path.realpath(os.path.join(FILE_DIR, os.pardir, os.pardir))
20sys.path.insert(0, INFRA_BOTS_DIR)
24URL =
"https://storage.googleapis.com/pub/gsutil.zip"
28 """Create the asset."""
30 subprocess.run([
"curl", URL,
"--output",
"gsutil.zip"], check=
True)
31 subprocess.run([
"unzip",
"gsutil.zip"], check=
True)
32 with open(
"./gsutil/VERSION",
"r")
as f:
33 version = f.read().strip()
34 if version != VERSION:
35 raise RuntimeError(
"Action version %s does not match expected version %s"
37 shutil.move(
'./gsutil', target_dir)
41 parser = argparse.ArgumentParser()
42 parser.add_argument(
'--target_dir',
'-t', required=
True)
43 args = parser.parse_args()
47if __name__ ==
'__main__':
def create_asset(chrome_src_path, browser_executable, target_dir, upload_to_partner_bucket, dm_path)