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

Side by Side Diff: third_party/node/update_node_binaries.sh

Issue 2574033002: Downloading Node and NPM deps via gclient sync. (Closed)
Patch Set: Add update scripts Created 3 years, 11 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 #!/bin/bash
Dan Beam 2017/01/10 22:09:13 copyright
2 # Script for updating Node binaries.
3 # 1) Update NODE_VERSION to the desired version.
4 # 2) Run this script.
5 # 3) Upload the binaries to the Google Storage bucket.
6 # 4) Land a CL with the changes generated by this script.
7
8 BASE_URL="https://nodejs.org/dist"
9 NODE_VERSION="v6.9.4"
10
11 update_mac () {
12 FILENAME="node-${NODE_VERSION}-darwin-x64.tar.gz"
13 FOLDER="mac"
14 URL="${BASE_URL}/${NODE_VERSION}/${FILENAME}"
15 if [ -f "${FOLDER}/${FILENAME}" ]; then
16 rm ${FOLDER}/${FILENAME}
17 fi
18 wget -P ${FOLDER}/ ${URL}
19
20 # Unpack temporarily, delete NPM symlink and re-pack.
21 tar xfz ${FOLDER}/${FILENAME} -C ${FOLDER}/
22 rm ${FOLDER}/${FILENAME}
23 rm ${FOLDER}/node-${NODE_VERSION}-darwin-x64/bin/npm
24 tar cfz ${FOLDER}/node-darwin-x64.tar.gz ${FOLDER}/node-${NODE_VERSION}-darwin -x64/
dpapad 2017/01/10 19:59:49 FWIW, this command is not 100% deterministic (the
25 sha1="$(sha1sum ${FOLDER}/node-darwin-x64.tar.gz | cut -d ' ' -f1)"
26 echo ${sha1} > ${FOLDER}/node-darwin-x64.tar.gz.sha1
27 echo "Please execute manually the following:"
28 echo "> gsutil.py cp ${FOLDER}/node-darwin-x64.tar.gz gs://chromium-nodejs/${N ODE_VERSION:1}/${sha1}"
29 echo "DONE updating Mac."
30 }
31
32 update_linux () {
33 FILENAME="node-${NODE_VERSION}-linux-x64.tar.xz"
34 FOLDER="linux"
35 URL="${BASE_URL}/${NODE_VERSION}/${FILENAME}"
36 if [ -f "${FOLDER}/${FILENAME}" ]; then
37 rm ${FOLDER}/${FILENAME}
38 fi
39 wget -P ${FOLDER}/ ${URL}
40
41 # Unpack temporarily, delete NPM symlink and re-pack as gz (not xz).
42 tar xf ${FOLDER}/${FILENAME} -C ${FOLDER}/
43 rm ${FOLDER}/${FILENAME}
44 rm ${FOLDER}/node-${NODE_VERSION}-linux-x64/bin/npm
45
46 tar cfz ${FOLDER}/node-linux-x64.tar.gz ${FOLDER}/node-${NODE_VERSION}-linux-x 64/
47 sha1="$(sha1sum ${FOLDER}/node-linux-x64.tar.gz | cut -d ' ' -f1)"
48 echo ${sha1} > ${FOLDER}/node-linux-x64.tar.gz.sha1
49 echo "Please execute manually the following:"
50 echo "> gsutil.py cp ${FOLDER}/node-linux-x64.tar.gz gs://chromium-nodejs/${NO DE_VERSION:1}/${sha1}"
51 echo "DONE updating Linux."
52 }
53
54 update_win () {
55 WINDOWS_FILENAME="node.exe"
56 FOLDER="win"
57 WINDOWS_URL="${BASE_URL}/${NODE_VERSION}/win-x64/${WINDOWS_FILENAME}"
58 if [ -f "${FOLDER}/${WINDOWS_FILENAME}" ]; then
59 rm ${FOLDER}/${WINDOWS_FILENAME}
60 fi
61 wget -P ${FOLDER}/ ${WINDOWS_URL}
62 sha1="$(sha1sum ${FOLDER}/node.exe | cut -d ' ' -f1)"
dpapad 2017/01/10 19:59:49 Perhaps we should also compress node.exe? I did no
Dan Beam 2017/01/10 22:03:28 i suspect that would not be useful
63 echo ${sha1} > ${FOLDER}/node.exe.sha1
64 echo "Please execute manually the following:"
65 echo "> gsutil.py cp ${FOLDER}/node.exe gs://chromium-nodejs/${NODE_VERSION:1} /${sha1}"
66 echo "DONE updating Windows."
67 }
68
69 update_linux
70 update_mac
71 update_win
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698