Ver Fonte

Merge pull request #12124 from murgatroid99/node_version_fix_backport

Backport changes to use the same Node version in different scripts
Michael Lumish há 8 anos atrás
pai
commit
699ef7690e

+ 5 - 4
templates/tools/dockerfile/node_deps.include

@@ -5,7 +5,8 @@
 RUN touch .profile
 RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.25.4/install.sh | bash
 # Install all versions of node that we want to test
-RUN /bin/bash -l -c "nvm install 0.12 && npm config set cache /tmp/npm-cache"
-RUN /bin/bash -l -c "nvm install 4 && npm config set cache /tmp/npm-cache"
-RUN /bin/bash -l -c "nvm install 5 && npm config set cache /tmp/npm-cache"
-RUN /bin/bash -l -c "nvm alias default 4"
+RUN /bin/bash -l -c "nvm install 4 && npm config set cache /tmp/npm-cache && npm install -g npm"
+RUN /bin/bash -l -c "nvm install 5 && npm config set cache /tmp/npm-cache && npm install -g npm"
+RUN /bin/bash -l -c "nvm install 6 && npm config set cache /tmp/npm-cache && npm install -g npm"
+RUN /bin/bash -l -c "nvm install 8 && npm config set cache /tmp/npm-cache && npm install -g npm"
+RUN /bin/bash -l -c "nvm alias default 8"

+ 1 - 13
tools/dockerfile/grpc_artifact_linux_x64/Dockerfile

@@ -64,19 +64,7 @@ RUN apt-get update && apt-key update && apt-get install -y \
 # Install Node dependencies
 RUN touch .profile
 RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.25.4/install.sh | bash
-RUN /bin/bash -l -c "nvm install 4 && npm install -g node-pre-gyp"
-
-##################
-# Python dependencies
-
-RUN apt-get update && apt-get install -y \
-    python-all-dev \
-    python3-all-dev \
-    python-pip
-
-RUN pip install pip --upgrade
-RUN pip install virtualenv
-RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0
+RUN /bin/bash -l -c "nvm install 8 && npm install -g node-pre-gyp"
 
 
 ##################

+ 1 - 13
tools/dockerfile/grpc_artifact_linux_x86/Dockerfile

@@ -64,19 +64,7 @@ RUN apt-get update && apt-key update && apt-get install -y \
 # Install Node dependencies
 RUN touch .profile
 RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.25.4/install.sh | bash
-RUN /bin/bash -l -c "nvm install 4 && npm install -g node-pre-gyp"
-
-##################
-# Python dependencies
-
-RUN apt-get update && apt-get install -y \
-    python-all-dev \
-    python3-all-dev \
-    python-pip
-
-RUN pip install pip --upgrade
-RUN pip install virtualenv
-RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0
+RUN /bin/bash -l -c "nvm install 8 && npm install -g node-pre-gyp"
 
 
 ##################

+ 5 - 4
tools/dockerfile/interoptest/grpc_interop_node/Dockerfile

@@ -85,10 +85,11 @@ RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0
 RUN touch .profile
 RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.25.4/install.sh | bash
 # Install all versions of node that we want to test
-RUN /bin/bash -l -c "nvm install 0.12 && npm config set cache /tmp/npm-cache"
-RUN /bin/bash -l -c "nvm install 4 && npm config set cache /tmp/npm-cache"
-RUN /bin/bash -l -c "nvm install 5 && npm config set cache /tmp/npm-cache"
-RUN /bin/bash -l -c "nvm alias default 4"
+RUN /bin/bash -l -c "nvm install 4 && npm config set cache /tmp/npm-cache && npm install -g npm"
+RUN /bin/bash -l -c "nvm install 5 && npm config set cache /tmp/npm-cache && npm install -g npm"
+RUN /bin/bash -l -c "nvm install 6 && npm config set cache /tmp/npm-cache && npm install -g npm"
+RUN /bin/bash -l -c "nvm install 8 && npm config set cache /tmp/npm-cache && npm install -g npm"
+RUN /bin/bash -l -c "nvm alias default 8"
 # Prepare ccache
 RUN ln -s /usr/bin/ccache /usr/local/bin/gcc
 RUN ln -s /usr/bin/ccache /usr/local/bin/g++

+ 5 - 4
tools/dockerfile/test/multilang_jessie_x64/Dockerfile

@@ -96,10 +96,11 @@ RUN apt-get update && apt-get -y install libgflags-dev libgtest-dev libc++-dev c
 RUN touch .profile
 RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.25.4/install.sh | bash
 # Install all versions of node that we want to test
-RUN /bin/bash -l -c "nvm install 0.12 && npm config set cache /tmp/npm-cache"
-RUN /bin/bash -l -c "nvm install 4 && npm config set cache /tmp/npm-cache"
-RUN /bin/bash -l -c "nvm install 5 && npm config set cache /tmp/npm-cache"
-RUN /bin/bash -l -c "nvm alias default 4"
+RUN /bin/bash -l -c "nvm install 4 && npm config set cache /tmp/npm-cache && npm install -g npm"
+RUN /bin/bash -l -c "nvm install 5 && npm config set cache /tmp/npm-cache && npm install -g npm"
+RUN /bin/bash -l -c "nvm install 6 && npm config set cache /tmp/npm-cache && npm install -g npm"
+RUN /bin/bash -l -c "nvm install 8 && npm config set cache /tmp/npm-cache && npm install -g npm"
+RUN /bin/bash -l -c "nvm alias default 8"
 #=================
 # PHP dependencies
 

+ 5 - 4
tools/dockerfile/test/node_jessie_x64/Dockerfile

@@ -100,10 +100,11 @@ RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 six==1.10.0
 RUN touch .profile
 RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.25.4/install.sh | bash
 # Install all versions of node that we want to test
-RUN /bin/bash -l -c "nvm install 0.12 && npm config set cache /tmp/npm-cache"
-RUN /bin/bash -l -c "nvm install 4 && npm config set cache /tmp/npm-cache"
-RUN /bin/bash -l -c "nvm install 5 && npm config set cache /tmp/npm-cache"
-RUN /bin/bash -l -c "nvm alias default 4"
+RUN /bin/bash -l -c "nvm install 4 && npm config set cache /tmp/npm-cache && npm install -g npm"
+RUN /bin/bash -l -c "nvm install 5 && npm config set cache /tmp/npm-cache && npm install -g npm"
+RUN /bin/bash -l -c "nvm install 6 && npm config set cache /tmp/npm-cache && npm install -g npm"
+RUN /bin/bash -l -c "nvm install 8 && npm config set cache /tmp/npm-cache && npm install -g npm"
+RUN /bin/bash -l -c "nvm alias default 8"
 # Prepare ccache
 RUN ln -s /usr/bin/ccache /usr/local/bin/gcc
 RUN ln -s /usr/bin/ccache /usr/local/bin/g++

+ 1 - 1
tools/run_tests/artifacts/build_artifact_node.sh

@@ -32,7 +32,7 @@ NODE_TARGET_ARCH=$1
 NODE_TARGET_OS=$2
 source ~/.nvm/nvm.sh
 
-nvm use 4
+nvm use 8
 set -ex
 
 cd $(dirname $0)/../../..

+ 1 - 1
tools/run_tests/artifacts/build_package_node.sh

@@ -30,7 +30,7 @@
 
 source ~/.nvm/nvm.sh
 
-nvm use 4
+nvm use 8
 set -ex
 
 cd $(dirname $0)/../../..

+ 2 - 1
tools/run_tests/helper_scripts/build_node_electron.sh

@@ -32,7 +32,7 @@
 ELECTRON_VERSION=$1
 source ~/.nvm/nvm.sh
 
-nvm use 6
+nvm use 8
 set -ex
 
 # change to grpc repo root
@@ -43,4 +43,5 @@ export npm_config_disturl=https://atom.io/download/atom-shell
 export npm_config_runtime=electron
 export npm_config_build_from_source=true
 mkdir -p ~/.electron-gyp
+HOME=~/.electron-gyp npm update --prefer-online
 HOME=~/.electron-gyp npm install --unsafe-perm

+ 0 - 3
tools/run_tests/helper_scripts/pre_build_node.sh

@@ -35,9 +35,6 @@ source ~/.nvm/nvm.sh
 nvm install $NODE_VERSION
 set -ex
 
-# Update npm to at least version 5
-npm update -g npm
-
 export GRPC_CONFIG=${CONFIG:-opt}
 
 npm update --prefer-online

+ 1 - 1
tools/run_tests/helper_scripts/pre_build_node_electron.sh

@@ -31,7 +31,7 @@
 
 ELECTRON_VERSION=$1
 
-nvm install 6
+nvm install 8
 set -ex
 
 npm install xvfb-maybe

+ 1 - 1
tools/run_tests/helper_scripts/run_node_electron.sh

@@ -30,7 +30,7 @@
 
 source ~/.nvm/nvm.sh
 
-nvm use 6
+nvm use 8
 set -ex
 
 # change to grpc repo root

+ 1 - 1
tools/run_tests/performance/run_worker_node.sh

@@ -29,7 +29,7 @@
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 source ~/.nvm/nvm.sh
-nvm use 7
+nvm use 8
 
 set -ex