From 87910a326b42789309707991a2d15c89f66ccca4 Mon Sep 17 00:00:00 2001 From: Jose Ivan Vargas Date: Thu, 2 Nov 2017 12:18:20 -0600 Subject: [PATCH 1/6] Add chrome-node-yarn image --- .gitlab-ci.yml | 2 ++ scripts/install-node | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bbade6e..0316e7e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -61,6 +61,7 @@ ruby-2.3.5-golang-1.8-git-2.13-phantomjs-2.1-node-8.x-yarn-1.0-postgresql-9.6 te ruby-2.4.1-golang-1.8-git-2.7-phantomjs-2.1-node-7.1-postgresql-9.6 test: *test_custom golang-1.8-git-2.8.4 test: *test_custom golang-1.8-git-2.13 test: *test_custom +node-8.9-chrome-62.0-yarn-1.2 test: *test_custom www-gitlab-com test: *test_build gitlab-qa test: *test_build @@ -89,6 +90,7 @@ ruby-2.3.5-golang-1.8-git-2.13-phantomjs-2.1-node-8.x-yarn-1.0-postgresql-9.6: * ruby-2.4.1-golang-1.8-git-2.7-phantomjs-2.1-node-7.1-postgresql-9.6: *build_and_deploy_custom golang-1.8-git-2.8.4: *build_and_deploy_custom golang-1.8-git-2.13: *build_and_deploy_custom +node-8.9-chrome-62.0-yarn-1.2: *build_and_deploy_custom www-gitlab-com: *build_and_deploy gitlab-qa: *build_and_deploy diff --git a/scripts/install-node b/scripts/install-node index 449eaa2..c50fc47 100755 --- a/scripts/install-node +++ b/scripts/install-node @@ -5,6 +5,8 @@ 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 - From e5d5250753854b6225d82fec1f00beda2b38989a Mon Sep 17 00:00:00 2001 From: Jose Ivan Vargas Date: Thu, 2 Nov 2017 15:46:03 -0600 Subject: [PATCH 2/6] Corrected the error of my ways in bash --- scripts/install-node | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install-node b/scripts/install-node index c50fc47..ab15cbb 100755 --- a/scripts/install-node +++ b/scripts/install-node @@ -5,7 +5,7 @@ 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 +NODE_VERSION=`echo $NODE_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 - From 5932ece8d036179d0ecc77592155e0d0d35522fc Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Thu, 2 Nov 2017 22:55:57 +0000 Subject: [PATCH 3/6] Handle patch releases inside NODE_VERSION --- scripts/install-node | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/install-node b/scripts/install-node index ab15cbb..06e9b84 100755 --- a/scripts/install-node +++ b/scripts/install-node @@ -5,7 +5,10 @@ set -xeo pipefail NODE_VERSION=${1:-7.x} YARN_VERSION=${2:-0.27.5-1} -NODE_VERSION=`echo $NODE_VERSION | sed -r -e "s/([0-9]+)\.[0-9]+/\1\.x/g"` +# 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"` # add official debian repos for node and yarn curl -sS -L https://deb.nodesource.com/setup_${NODE_VERSION} | bash - From 5ee94c9921dbc6aa8742864300bdc2c91f5b702a Mon Sep 17 00:00:00 2001 From: Jose Ivan Vargas Date: Tue, 7 Nov 2017 10:43:40 -0600 Subject: [PATCH 4/6] renamed node and yarn variables --- Dockerfile.custom | 6 +++--- scripts/custom-docker-build | 12 ++++++------ scripts/install-node | 12 ++++++------ 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Dockerfile.custom b/Dockerfile.custom index 2658f0a..e4177c7 100644 --- a/Dockerfile.custom +++ b/Dockerfile.custom @@ -28,9 +28,9 @@ ARG PHANTOMJS_VERSION RUN if [ -n "$PHANTOMJS_VERSION" ] ; then /scripts/install-phantomjs $PHANTOMJS_VERSION; fi # NodeJS and Yarn -ARG NODE_VERSION -ARG YARN_VERSION -RUN if [ -n "$NODE_VERSION" ] ; then /scripts/install-node $NODE_VERSION $YARN_VERSION && node --version && yarn --version; fi +ARG NODE_INSTALL_VERSION +ARG YARN_INSTALL_VERSION +RUN if [ -n "$NODE_INSTALL_VERSION" ] ; then /scripts/install-node $NODE_INSTALL_VERSION $YARN_INSTALL_VERSION && node --version && yarn --version; fi # Golang ARG GOLANG_VERSION diff --git a/scripts/custom-docker-build b/scripts/custom-docker-build index fe651d4..4eaab71 100755 --- a/scripts/custom-docker-build +++ b/scripts/custom-docker-build @@ -59,20 +59,20 @@ function print_phantomjs_args() { function print_node_args() { case "$1" in - 7.x|7.1) NODE_VERSION=7.x ;; - 8.x) NODE_VERSION=8.x ;; + 7.x|7.1) NODE_INSTALL_VERSION=7.x ;; + 8.x) NODE_INSTALL_VERSION=8.x ;; *) echo "Unknown node version $1"; exit 1; esac - printf -- "--build-arg NODE_VERSION=%s " "$NODE_VERSION" + printf -- "--build-arg NODE_INSTALL_VERSION=%s " "$NODE_INSTALL_VERSION" } function print_yarn_args() { case "$1" in - 1.0) YARN_VERSION=1.0.2-1 ;; - 1.2) YARN_VERSION=1.2.1-1 ;; + 1.0) YARN_INSTALL_VERSION=1.0.2-1 ;; + 1.2) YARN_INSTALL_VERSION=1.2.1-1 ;; *) echo "Unknown yarn version $1"; exit 1; esac - printf -- "--build-arg YARN_VERSION=%s " "$YARN_VERSION" + printf -- "--build-arg YARN_INSTALL_VERSION=%s " "$YARN_INSTALL_VERSION" } function print_postgres_args() { diff --git a/scripts/install-node b/scripts/install-node index 06e9b84..7eb9a78 100755 --- a/scripts/install-node +++ b/scripts/install-node @@ -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 From 2365d40ef939f1c443ac77605ecaedac8a417d01 Mon Sep 17 00:00:00 2001 From: Jose Ivan Vargas Date: Tue, 7 Nov 2017 11:55:28 -0600 Subject: [PATCH 5/6] update chrome --- scripts/custom-docker-build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/custom-docker-build b/scripts/custom-docker-build index 4eaab71..9e92b4e 100755 --- a/scripts/custom-docker-build +++ b/scripts/custom-docker-build @@ -21,7 +21,7 @@ function print_chrome_args() { case "$1" in 60|60.0) CHROME_VERSION=60.0.3112.90-1 ;; 61|61.0) CHROME_VERSION=61.0.3163.100-1 ;; - 62|62.0) CHROME_VERSION=62.0.3202.75-1 ;; + 62|62.0) CHROME_VERSION=62.0.3202.89-1 ;; *) echo "Unknown chrome version $1"; exit 1; esac printf -- "--build-arg CHROME_VERSION=%s " "$CHROME_VERSION" From af7bfb8e6a8ee6af091b6d77a27bced25ac97a43 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Tue, 7 Nov 2017 18:25:27 +0000 Subject: [PATCH 6/6] Remove unnecessary comment --- scripts/install-node | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/install-node b/scripts/install-node index 7eb9a78..da509a3 100755 --- a/scripts/install-node +++ b/scripts/install-node @@ -6,8 +6,6 @@ NODE_INSTALL_VERSION=${1:-7.x} YARN_INSTALL_VERSION=${2:-0.27.5-1} # Map MAJOR.MINOR.patch -> MAJOR.x -# -# 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