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

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

Issue 659733003: Revert "Remove 'mojo_' prefix from all mojo applications." (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 | « mojo/tools/data/unittests ('k') | tools/find_depot_tools.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 # Copyright 2014 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5
6 import os
7 import subprocess
8 import sys
9 import tempfile
10 import time
11 import zipfile
12
13 root_path = os.path.join(os.path.dirname(os.path.realpath(__file__)),
14 "..", "..")
15 version_path = os.path.join(root_path, "mojo", "public", "VERSION")
16 version_file = open(version_path)
17 version = version_file.read().strip()
18
19 sys.path.insert(0, os.path.join(root_path, "tools"))
20
21 binary_path = os.path.join(root_path, "out", "Release", "mojo_shell")
22
23 dest = "gs://mojo/shell/" + version + "/linux-x64.zip"
24
25 with tempfile.NamedTemporaryFile() as zip_file:
26 with zipfile.ZipFile(zip_file, 'w') as z:
27 with open(binary_path) as shell_binary:
28 zipinfo = zipfile.ZipInfo("mojo_shell")
29 zipinfo.external_attr = 0777 << 16L
30 zipinfo.compress_type = zipfile.ZIP_DEFLATED
31 zipinfo.date_time = time.gmtime(os.path.getmtime(binary_path))
32 z.writestr(zipinfo, shell_binary.read())
33 subprocess.check_call(["gsutil", "cp", zip_file.name, dest])
OLDNEW
« no previous file with comments | « mojo/tools/data/unittests ('k') | tools/find_depot_tools.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698