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

Unified Diff: sky/tools/upload_sky_server

Issue 1132793004: Add sky_server for mac host (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: updated upload_sky_server Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
« sky/tools/download_sky_server ('K') | « sky/tools/skygo/sky_server_mac.sha1 ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/tools/upload_sky_server
diff --git a/sky/tools/upload_sky_server b/sky/tools/upload_sky_server
new file mode 100755
index 0000000000000000000000000000000000000000..bdf114e2499e88ed2fa6c2e35943eed8093c6f10
--- /dev/null
+++ b/sky/tools/upload_sky_server
@@ -0,0 +1,58 @@
+#!/usr/bin/env python
+# Copyright (c) 2015 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import os
+import stat
+import subprocess
+import sys
+
+from webkitpy.common.system import filesystem
+from webkitpy.common.webkit_finder import WebKitFinder
+
+PLATFORM_MAPPING = {
+ 'cygwin': 'win',
+ 'darwin': 'mac',
+ 'linux2': 'linux',
+ 'win32': 'win',
+}
+
+def main(args):
+ filename = 'sky_server';
+ if not os.path.exists(filename):
+ print >> sys.stderr, ('%s not found in the current directory.'
+ % filename)
+ return 1
+
+ upload_filename = filename + '_' + PLATFORM_MAPPING[sys.platform]
jamesr 2015/05/21 21:33:05 we should share this logic with the downloader scr
+ try:
+ print 'Symlink %s to %s...' % (filename, upload_filename)
+ os.symlink(filename, upload_filename)
+ except OSError:
+ print >> sys.stderr, 'failed to create a symlink.'
+ return 2
+
+ finder = WebKitFinder(filesystem.FileSystem())
+
+ print 'Upload %s...' % upload_filename
+ subprocess.call([
+ 'upload_to_google_storage.py',
+ '--bucket', 'mojo',
+ finder.path_from_chromium_base('sky', 'tools', 'skygo',
+ upload_filename),
+ ])
+
+ print 'Clean up the symlink...'
+ try:
+ os.remove(upload_filename)
+ except OSError:
+ print >> sys.stderr, 'failed to remove %s.' % upload_filename
+ return 3
+
+if __name__ == '__main__':
+ try:
+ sys.exit(main(sys.argv))
+ except KeyboardInterrupt:
+ sys.stderr.write('interrupted\n')
+ sys.exit(1)
« sky/tools/download_sky_server ('K') | « sky/tools/skygo/sky_server_mac.sha1 ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698