Skip to content

Commit

Permalink
Simplify build script (#666)
Browse files Browse the repository at this point in the history
* Simplify build script

* Do not check for worker.yaml, none of the examples have one

* Shorten version string
  • Loading branch information
fhinkel authored Jun 18, 2018
1 parent 12a666d commit a42e9c1
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions .kokoro/build-with-appengine.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,22 @@ gcloud auth activate-service-account --key-file "$GOOGLE_APPLICATION_CREDENTIALS
gcloud config set project $GCLOUD_PROJECT

export NODE_ENV=development
export GAE_VERSION=doc-sample-$(echo $PROJECT | sed 's_/_-_g')

# Strip appengine and flexible/standard from version string.
VERSION=$(echo $PROJECT | sed 's_appengine/__')
VERSION=$(echo $VERSION | sed 's_/flexible\|standard__')

export GAE_VERSION=$VERSION

# Register post-test cleanup
function cleanup {
gcloud app versions delete $GAE_VERSION --quiet
if [ -e "worker.yaml" ]; then
gcloud app versions delete ${GAE_VERSION}-worker --quiet
fi
}
trap cleanup EXIT


cd github/nodejs-docs-samples/${PROJECT}

# Install dependencies
npm install

# Configure gcloud
export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR}/secrets-key.json
Expand All @@ -49,12 +49,10 @@ gcloud config set project $GCLOUD_PROJECT

# Deploy the app
gcloud app deploy --version $GAE_VERSION --no-promote --quiet
if [ -e "worker.yaml" ]; then
gcloud app deploy worker.yaml --version ${GAE_VERSION} --no-promote --quiet
fi


# Test the deployed app
# Install dependencies and run tests
npm install
npm test

exit $?

0 comments on commit a42e9c1

Please sign in to comment.