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

Side by Side Diff: third_party/WebKit/Source/devtools/scripts/buildbot/node.py

Issue 2303273003: DevTools: Bump node.js version for buildbot (Closed)
Patch Set: Created 4 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2016 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2016 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 import os 6 import os
7 import shutil 7 import shutil
8 import sys 8 import sys
9 import subprocess 9 import subprocess
10 import tarfile 10 import tarfile
11 import tempfile 11 import tempfile
12 import urllib2 12 import urllib2
13 13
14 THIS_DIR = os.path.dirname(os.path.abspath(__file__)) 14 THIS_DIR = os.path.dirname(os.path.abspath(__file__))
15 15
16 DEFAULT_VERSION = '0.12.2' 16 DEFAULT_VERSION = '4.5.0'
17 BUCKET = 'chromium-infra-bins' 17 BUCKET = 'chromium-nodejs'
18 18
19 19
20 def install_latest_node_js(version, tmp_dir): 20 def install_latest_node_js(version, tmp_dir):
21 target_dir = os.path.join(THIS_DIR, 'runtimes', version) 21 target_dir = os.path.join(THIS_DIR, 'runtimes', version)
22 version_file = os.path.join(target_dir, 'VERSION') 22 version_file = os.path.join(target_dir, 'VERSION')
23 23
24 if sys.platform == 'win32': 24 if sys.platform == 'win32':
25 bin_location = os.path.join(target_dir, 'node.exe') 25 bin_location = os.path.join(target_dir, 'node.exe')
26 else: 26 else:
27 bin_location = os.path.join(target_dir, 'bin', 'node') 27 bin_location = os.path.join(target_dir, 'bin', 'node')
(...skipping 11 matching lines...) Expand all
39 if sys.platform == 'win32': 39 if sys.platform == 'win32':
40 target = 'node.exe' 40 target = 'node.exe'
41 elif sys.platform == 'darwin': 41 elif sys.platform == 'darwin':
42 target = 'node-v%s-darwin-x86.tar.gz' % version 42 target = 'node-v%s-darwin-x86.tar.gz' % version
43 elif sys.platform == 'linux2': 43 elif sys.platform == 'linux2':
44 target = 'node-v%s-linux-x86.tar.gz' % version 44 target = 'node-v%s-linux-x86.tar.gz' % version
45 else: 45 else:
46 raise Exception('Unrecognized platform %s' % sys.platform) 46 raise Exception('Unrecognized platform %s' % sys.platform)
47 47
48 dest = os.path.join(tmp_dir, 'node_download') 48 dest = os.path.join(tmp_dir, 'node_download')
49 url = 'https://storage.googleapis.com/%s/node/%s/%s' % ( 49 url = 'https://storage.googleapis.com/%s/%s/%s' % (
50 BUCKET, version, target) 50 BUCKET, version, target)
51 print('Fetching %s' % url) 51 print('Fetching %s' % url)
52 u = urllib2.urlopen(url) 52 u = urllib2.urlopen(url)
53 with open(dest, 'wb') as f: 53 with open(dest, 'wb') as f:
54 while True: 54 while True:
55 chunk = u.read(2 ** 20) 55 chunk = u.read(2 ** 20)
56 if not chunk: 56 if not chunk:
57 break 57 break
58 f.write(chunk) 58 f.write(chunk)
59 59
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 110
111 if mode == 'npm': 111 if mode == 'npm':
112 # TODO(hinoka): How about Windows...? 112 # TODO(hinoka): How about Windows...?
113 bin_location = os.path.join(os.path.dirname(bin_location), 'npm') 113 bin_location = os.path.join(os.path.dirname(bin_location), 'npm')
114 114
115 return subprocess.call([bin_location, ] + sys.argv[1:]) 115 return subprocess.call([bin_location, ] + sys.argv[1:])
116 116
117 117
118 if __name__ == '__main__': 118 if __name__ == '__main__':
119 sys.exit(main()) 119 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698