From c164c349d5b618aee8260e0d3a42abbf7391e9e5 Mon Sep 17 00:00:00 2001 From: Ace Nassri Date: Wed, 12 Sep 2018 15:25:16 -0700 Subject: [PATCH] Install emulator lazily + actually fetch secrets --- .kokoro/build.sh | 2 +- .kokoro/functions/common.cfg | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 6cb331b6c7..edb1afe28c 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -23,7 +23,6 @@ export FUNCTIONS_BUCKET=my-bucket cd github/nodejs-docs-samples/${PROJECT} # Install dependencies -npm install -g @google-cloud/functions-emulator npm install # Configure gcloud @@ -33,6 +32,7 @@ gcloud config set project $GCLOUD_PROJECT # Start functions emulator, if appropriate if [[ $PROJECT == functions/* ]]; then + npm install -g @google-cloud/functions-emulator functions-emulator start fi diff --git a/.kokoro/functions/common.cfg b/.kokoro/functions/common.cfg index 881f2f9de4..8ca89d179a 100644 --- a/.kokoro/functions/common.cfg +++ b/.kokoro/functions/common.cfg @@ -3,6 +3,9 @@ # Download trampoline resources. These will be in ${KOKORO_GFILE_DIR} gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" +# Download secrets from Cloud Storage. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/nodejs-docs-samples" + # All builds use the trampoline script to run in docker. build_file: "nodejs-docs-samples/.kokoro/trampoline.sh"