about summary refs log tree commit diff
path: root/src/ci/docker/scripts/nodejs.sh
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-04-21 01:06:10 +0000
committerbors <bors@rust-lang.org>2024-04-21 01:06:10 +0000
commit426a698606ca94d4c4a674a346c701bf44b0aeb3 (patch)
treeb0587b3ba5ddb0abe7e5ed8163075d6381f1f3d9 /src/ci/docker/scripts/nodejs.sh
parent453ceafce32ef8108c604bca5e165ab41d3d6d8c (diff)
parenta920ed4136317cc8a44f3e62ac86143859507772 (diff)
downloadrust-426a698606ca94d4c4a674a346c701bf44b0aeb3.tar.gz
rust-426a698606ca94d4c4a674a346c701bf44b0aeb3.zip
Auto merge of #123981 - Kobzol:update-nodejs, r=Mark-Simulacrum
CI: add script for installing NodeJS and update it to v20

I centralized the installation on a single place to make it simple to update the NodeJS version across the board.

Fixes: https://github.com/rust-lang/rust/issues/123965

r? `@Mark-Simulacrum`
Diffstat (limited to 'src/ci/docker/scripts/nodejs.sh')
-rw-r--r--src/ci/docker/scripts/nodejs.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/ci/docker/scripts/nodejs.sh b/src/ci/docker/scripts/nodejs.sh
new file mode 100644
index 00000000000..ae28da0bdc7
--- /dev/null
+++ b/src/ci/docker/scripts/nodejs.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+set -ex
+
+NODEJS_VERSION=v20.12.2
+INSTALL_PATH=${1:-/node}
+
+url="https://nodejs.org/dist/${NODEJS_VERSION}/node-${NODEJS_VERSION}-linux-x64.tar.xz"
+curl -sL "$url" | tar -xJ
+mv node-${NODEJS_VERSION}-linux-x64 "${INSTALL_PATH}"