| Index: mojo/tools/upload_shell_binary.py
|
| diff --git a/mojo/tools/upload_shell_binary.py b/mojo/tools/upload_shell_binary.py
|
| new file mode 100755
|
| index 0000000000000000000000000000000000000000..5d5cd2a189d6e3ac66ced409041834384e759541
|
| --- /dev/null
|
| +++ b/mojo/tools/upload_shell_binary.py
|
| @@ -0,0 +1,27 @@
|
| +#!/usr/bin/env python
|
| +
|
| +import os
|
| +import subprocess
|
| +import tempfile
|
| +import time
|
| +import zipfile
|
| +
|
| +root_path = os.path.join(os.path.dirname(os.path.realpath(__file__)),
|
| + "..", "..")
|
| +version_path = os.path.join(root_path, "mojo", "public", "VERSION")
|
| +version_file = open(version_path)
|
| +version = version_file.read().strip()
|
| +
|
| +binary_path = os.path.join(root_path, "out", "Release", "mojo_shell")
|
| +
|
| +dest = "gs://mojo/shell/" + version + "/linux-x64.zip"
|
| +
|
| +with tempfile.NamedTemporaryFile() as zip_file:
|
| + with zipfile.ZipFile(zip_file, 'w') as z:
|
| + with open(binary_path) as shell_binary:
|
| + zipinfo = zipfile.ZipInfo("mojo_shell")
|
| + zipinfo.external_attr = 0777 << 16L
|
| + zipinfo.compress_type = zipfile.ZIP_DEFLATED
|
| + zipinfo.date_time = time.gmtime(os.path.getmtime(binary_path))
|
| + z.writestr(zipinfo, shell_binary.read())
|
| + subprocess.check_call(["gsutil", "cp", zip_file.name, dest])
|
|
|