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

Side by Side Diff: mojo/tools/upload_shell_binary.py

Issue 667853002: Add gclient hook to download prebuilt mojo_shell (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
OLDNEW
(Empty)
1 #!/usr/bin/env python
2
3 import os
4 import subprocess
5 import tempfile
6 import time
7 import zipfile
8
9 root_path = os.path.join(os.path.dirname(os.path.realpath(__file__)),
10 "..", "..")
11 version_path = os.path.join(root_path, "mojo", "public", "VERSION")
12 version_file = open(version_path)
13 version = version_file.read().strip()
14
15 binary_path = os.path.join(root_path, "out", "Release", "mojo_shell")
16
17 dest = "gs://mojo/shell/" + version + "/linux-x64.zip"
18
19 with tempfile.NamedTemporaryFile() as zip_file:
20 with zipfile.ZipFile(zip_file, 'w') as z:
21 with open(binary_path) as shell_binary:
22 zipinfo = zipfile.ZipInfo("mojo_shell")
23 zipinfo.external_attr = 0777 << 16L
24 zipinfo.compress_type = zipfile.ZIP_DEFLATED
25 zipinfo.date_time = time.gmtime(os.path.getmtime(binary_path))
26 z.writestr(zipinfo, shell_binary.read())
27 subprocess.check_call(["gsutil", "cp", zip_file.name, dest])
OLDNEW
« mojo/public/tools/download_shell_binary.py ('K') | « mojo/shell/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698