Skip to content

Commit

Permalink
Load nvm correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
fhinkel committed Jun 19, 2018
1 parent e339d49 commit 200c9e7
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 7 deletions.
8 changes: 7 additions & 1 deletion .kokoro/e2e-tests/build.sh
Expand Up @@ -14,10 +14,17 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# Fail on error
set -e;

# Remove old logs/YAML files
rm -rf */*.log
rm -rf *-*.yaml

# Load the Node version manager
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm

# Install the latest version of Node 8
nvm install 8

Expand Down Expand Up @@ -45,7 +52,6 @@ function cleanup {
gsutil cp ${BADGE_URL}/${DATA_BACKEND}-${STATUS}.svg ${BADGE_URL}/${GAE_VERSION}.svg
}
trap cleanup EXIT
set -e;

# Configure gcloud
export GCLOUD_PROJECT=nodejs-getting-started-tests
Expand Down
8 changes: 8 additions & 0 deletions .kokoro/e2e-tests/container/build.sh
Expand Up @@ -67,6 +67,14 @@ export MYSQL_PASSWORD=$(cat ${KOKORO_GFILE_DIR}/secrets-mysql-password.json)
export MONGO_URL=$(cat ${KOKORO_GFILE_DIR}/secrets-mongo-url.json)
export INSTANCE_CONNECTION_NAME="${GCLOUD_PROJECT}:us-central1:integration-test-instance"


# Load the Node version manager
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm

# Install the latest version of Node 8
nvm install 8

# Install Node dependencies
yarn global add @google-cloud/nodejs-repo-tools
cd github/nodejs-getting-started/${BOOKSHELF_DIRECTORY}
Expand Down
13 changes: 10 additions & 3 deletions .kokoro/system-tests/cloudsql.sh
Expand Up @@ -18,6 +18,9 @@
# - Each system test uses a different script for system tests. This is due to the need for database/proxy commands
# - The end-to-end (E2E) tests don't need additional commands (GAE handles that), so they use a common test script

# Fail on error
set -e;

# Remove old logs/YAML files
rm -rf */*.log
rm -rf *-*.yaml
Expand All @@ -31,6 +34,13 @@ export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR}/secrets-key.json
gcloud auth activate-service-account --key-file "$GOOGLE_APPLICATION_CREDENTIALS"
gcloud config set project $GCLOUD_PROJECT

# Load the Node version manager
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm

# Use Node 8
nvm install 8

# Install Node dependencies
yarn global add @google-cloud/nodejs-repo-tools
cd github/nodejs-getting-started
Expand All @@ -42,9 +52,6 @@ find . -name package.json -maxdepth 2 -execdir sh -c "cp $GOOGLE_APPLICATION_CRE
# Start SQL proxy
cloud_sql_proxy -instances="${GCLOUD_PROJECT}:us-central1:integration-test-instance"=tcp:3306 &

# Fail on error
set -e;

# Install dependencies (for running the tests, not the apps themselves)
yarn install

Expand Down
13 changes: 10 additions & 3 deletions .kokoro/system-tests/datastore.sh
Expand Up @@ -18,6 +18,9 @@
# - Each system test uses a different script for system tests. This is due to the need for database/proxy commands
# - The end-to-end (E2E) tests don't need additional commands (GAE handles that), so they use a common test script

# Fail on error
set -e;

# Remove old logs/YAML files
rm -rf */*.log
rm -rf *-*.yaml
Expand All @@ -31,6 +34,13 @@ export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR}/secrets-key.json
gcloud auth activate-service-account --key-file "$GOOGLE_APPLICATION_CREDENTIALS"
gcloud config set project $GCLOUD_PROJECT

# Load the Node version manager
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm

# Use Node 8
nvm install 8

# Install Node dependencies
yarn global add @google-cloud/nodejs-repo-tools
cd github/nodejs-getting-started
Expand All @@ -39,9 +49,6 @@ cd github/nodejs-getting-started
find . -name package.json -maxdepth 2 -execdir sh -c "cp ${KOKORO_GFILE_DIR}/secrets-config.json config.json" \;
find . -name package.json -maxdepth 2 -execdir sh -c "cp $GOOGLE_APPLICATION_CREDENTIALS key.json" \;

# Fail on error
set -e;

# Install dependencies (for running the tests, not the apps themselves)
yarn install

Expand Down

0 comments on commit 200c9e7

Please sign in to comment.