renamed node and yarn variables

This commit is contained in:
Jose Ivan Vargas 2017-11-07 10:43:40 -06:00
parent 5932ece8d0
commit 5ee94c9921
3 changed files with 15 additions and 15 deletions

View file

@ -2,18 +2,18 @@
set -xeo pipefail
NODE_VERSION=${1:-7.x}
YARN_VERSION=${2:-0.27.5-1}
NODE_INSTALL_VERSION=${1:-7.x}
YARN_INSTALL_VERSION=${2:-0.27.5-1}
# Map MAJOR.MINOR.patch -> MAJOR.x
#
# NODE_VERSION may resolve to the full version if inside a node container image.
NODE_VERSION=`echo $NODE_VERSION | sed -r -e "s/([0-9]+)\.[0-9]+.*/\1\.x/g"`
# NODE_INSTALL_VERSION may resolve to the full version if inside a node container image.
NODE_INSTALL_VERSION=`echo $NODE_INSTALL_VERSION | sed -r -e "s/([0-9]+)\.[0-9]+.*/\1\.x/g"`
# add official debian repos for node and yarn
curl -sS -L https://deb.nodesource.com/setup_${NODE_VERSION} | bash -
curl -sS -L https://deb.nodesource.com/setup_${NODE_INSTALL_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
apt-get install -y nodejs yarn=$YARN_INSTALL_VERSION