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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: third_party/node/update_node_binaries.sh
diff --git a/third_party/node/update_node_binaries.sh b/third_party/node/update_node_binaries.sh
new file mode 100755
index 0000000000000000000000000000000000000000..be8a84cceeb254ebecb3512b454a01ab0d444ab0
--- /dev/null
+++ b/third_party/node/update_node_binaries.sh
@@ -0,0 +1,71 @@
+#!/bin/bash
Dan Beam 2017/01/10 22:09:13 copyright
+# Script for updating Node binaries.
+# 1) Update NODE_VERSION to the desired version.
+# 2) Run this script.
+# 3) Upload the binaries to the Google Storage bucket.
+# 4) Land a CL with the changes generated by this script.
+
+BASE_URL="https://nodejs.org/dist"
+NODE_VERSION="v6.9.4"
+
+update_mac () {
+ FILENAME="node-${NODE_VERSION}-darwin-x64.tar.gz"
+ FOLDER="mac"
+ URL="${BASE_URL}/${NODE_VERSION}/${FILENAME}"
+ if [ -f "${FOLDER}/${FILENAME}" ]; then
+ rm ${FOLDER}/${FILENAME}
+ fi
+ wget -P ${FOLDER}/ ${URL}
+
+ # Unpack temporarily, delete NPM symlink and re-pack.
+ tar xfz ${FOLDER}/${FILENAME} -C ${FOLDER}/
+ rm ${FOLDER}/${FILENAME}
+ rm ${FOLDER}/node-${NODE_VERSION}-darwin-x64/bin/npm
+ 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
+ sha1="$(sha1sum ${FOLDER}/node-darwin-x64.tar.gz | cut -d ' ' -f1)"
+ echo ${sha1} > ${FOLDER}/node-darwin-x64.tar.gz.sha1
+ echo "Please execute manually the following:"
+ echo "> gsutil.py cp ${FOLDER}/node-darwin-x64.tar.gz gs://chromium-nodejs/${NODE_VERSION:1}/${sha1}"
+ echo "DONE updating Mac."
+}
+
+update_linux () {
+ FILENAME="node-${NODE_VERSION}-linux-x64.tar.xz"
+ FOLDER="linux"
+ URL="${BASE_URL}/${NODE_VERSION}/${FILENAME}"
+ if [ -f "${FOLDER}/${FILENAME}" ]; then
+ rm ${FOLDER}/${FILENAME}
+ fi
+ wget -P ${FOLDER}/ ${URL}
+
+ # Unpack temporarily, delete NPM symlink and re-pack as gz (not xz).
+ tar xf ${FOLDER}/${FILENAME} -C ${FOLDER}/
+ rm ${FOLDER}/${FILENAME}
+ rm ${FOLDER}/node-${NODE_VERSION}-linux-x64/bin/npm
+
+ tar cfz ${FOLDER}/node-linux-x64.tar.gz ${FOLDER}/node-${NODE_VERSION}-linux-x64/
+ sha1="$(sha1sum ${FOLDER}/node-linux-x64.tar.gz | cut -d ' ' -f1)"
+ echo ${sha1} > ${FOLDER}/node-linux-x64.tar.gz.sha1
+ echo "Please execute manually the following:"
+ echo "> gsutil.py cp ${FOLDER}/node-linux-x64.tar.gz gs://chromium-nodejs/${NODE_VERSION:1}/${sha1}"
+ echo "DONE updating Linux."
+}
+
+update_win () {
+ WINDOWS_FILENAME="node.exe"
+ FOLDER="win"
+ WINDOWS_URL="${BASE_URL}/${NODE_VERSION}/win-x64/${WINDOWS_FILENAME}"
+ if [ -f "${FOLDER}/${WINDOWS_FILENAME}" ]; then
+ rm ${FOLDER}/${WINDOWS_FILENAME}
+ fi
+ wget -P ${FOLDER}/ ${WINDOWS_URL}
+ 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
+ echo ${sha1} > ${FOLDER}/node.exe.sha1
+ echo "Please execute manually the following:"
+ echo "> gsutil.py cp ${FOLDER}/node.exe gs://chromium-nodejs/${NODE_VERSION:1}/${sha1}"
+ echo "DONE updating Windows."
+}
+
+update_linux
+update_mac
+update_win

Powered by Google App Engine
This is Rietveld 408576698