mirror of
https://ops.gitlab.net/gitlab-org/gitlab-build-images.git
synced 2025-12-10 02:22:57 +01:00
renamed node and yarn variables
This commit is contained in:
parent
5932ece8d0
commit
5ee94c9921
3 changed files with 15 additions and 15 deletions
|
|
@ -28,9 +28,9 @@ ARG PHANTOMJS_VERSION
|
||||||
RUN if [ -n "$PHANTOMJS_VERSION" ] ; then /scripts/install-phantomjs $PHANTOMJS_VERSION; fi
|
RUN if [ -n "$PHANTOMJS_VERSION" ] ; then /scripts/install-phantomjs $PHANTOMJS_VERSION; fi
|
||||||
|
|
||||||
# NodeJS and Yarn
|
# NodeJS and Yarn
|
||||||
ARG NODE_VERSION
|
ARG NODE_INSTALL_VERSION
|
||||||
ARG YARN_VERSION
|
ARG YARN_INSTALL_VERSION
|
||||||
RUN if [ -n "$NODE_VERSION" ] ; then /scripts/install-node $NODE_VERSION $YARN_VERSION && node --version && yarn --version; fi
|
RUN if [ -n "$NODE_INSTALL_VERSION" ] ; then /scripts/install-node $NODE_INSTALL_VERSION $YARN_INSTALL_VERSION && node --version && yarn --version; fi
|
||||||
|
|
||||||
# Golang
|
# Golang
|
||||||
ARG GOLANG_VERSION
|
ARG GOLANG_VERSION
|
||||||
|
|
|
||||||
|
|
@ -59,20 +59,20 @@ function print_phantomjs_args() {
|
||||||
|
|
||||||
function print_node_args() {
|
function print_node_args() {
|
||||||
case "$1" in
|
case "$1" in
|
||||||
7.x|7.1) NODE_VERSION=7.x ;;
|
7.x|7.1) NODE_INSTALL_VERSION=7.x ;;
|
||||||
8.x) NODE_VERSION=8.x ;;
|
8.x) NODE_INSTALL_VERSION=8.x ;;
|
||||||
*) echo "Unknown node version $1"; exit 1;
|
*) echo "Unknown node version $1"; exit 1;
|
||||||
esac
|
esac
|
||||||
printf -- "--build-arg NODE_VERSION=%s " "$NODE_VERSION"
|
printf -- "--build-arg NODE_INSTALL_VERSION=%s " "$NODE_INSTALL_VERSION"
|
||||||
}
|
}
|
||||||
|
|
||||||
function print_yarn_args() {
|
function print_yarn_args() {
|
||||||
case "$1" in
|
case "$1" in
|
||||||
1.0) YARN_VERSION=1.0.2-1 ;;
|
1.0) YARN_INSTALL_VERSION=1.0.2-1 ;;
|
||||||
1.2) YARN_VERSION=1.2.1-1 ;;
|
1.2) YARN_INSTALL_VERSION=1.2.1-1 ;;
|
||||||
*) echo "Unknown yarn version $1"; exit 1;
|
*) echo "Unknown yarn version $1"; exit 1;
|
||||||
esac
|
esac
|
||||||
printf -- "--build-arg YARN_VERSION=%s " "$YARN_VERSION"
|
printf -- "--build-arg YARN_INSTALL_VERSION=%s " "$YARN_INSTALL_VERSION"
|
||||||
}
|
}
|
||||||
|
|
||||||
function print_postgres_args() {
|
function print_postgres_args() {
|
||||||
|
|
|
||||||
|
|
@ -2,18 +2,18 @@
|
||||||
|
|
||||||
set -xeo pipefail
|
set -xeo pipefail
|
||||||
|
|
||||||
NODE_VERSION=${1:-7.x}
|
NODE_INSTALL_VERSION=${1:-7.x}
|
||||||
YARN_VERSION=${2:-0.27.5-1}
|
YARN_INSTALL_VERSION=${2:-0.27.5-1}
|
||||||
|
|
||||||
# Map MAJOR.MINOR.patch -> MAJOR.x
|
# Map MAJOR.MINOR.patch -> MAJOR.x
|
||||||
#
|
#
|
||||||
# NODE_VERSION may resolve to the full version if inside a node container image.
|
# NODE_INSTALL_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=`echo $NODE_INSTALL_VERSION | sed -r -e "s/([0-9]+)\.[0-9]+.*/\1\.x/g"`
|
||||||
|
|
||||||
# add official debian repos for node and yarn
|
# 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 -
|
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
|
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
|
||||||
|
|
||||||
apt-get update
|
apt-get update
|
||||||
apt-get install -y nodejs yarn=$YARN_VERSION
|
apt-get install -y nodejs yarn=$YARN_INSTALL_VERSION
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue