gitlab-build-images/scripts/install-node
2017-11-02 15:41:06 -06:00

16 lines
480 B
Bash
Executable file

#!/bin/bash
set -xeo pipefail
NODE_VERSION=${1:-7.x}
YARN_VERSION=${2:-0.27.5-1}
if [ "$NODE_VERSION" = 8.9.0 ]; then NODE_VERSION=8.x; fi
# add official debian repos for node and yarn
curl -sS -L https://deb.nodesource.com/setup_${NODE_VERSION} | bash -
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
apt-get update
apt-get install -y nodejs yarn=$YARN_VERSION