Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Kokoro config for appengine-datastore #642

Merged
merged 2 commits into from
Jun 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .kokoro/appengine-datastore.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Download secrets from Cloud Storage.
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/nodejs-docs-samples"

# Tell the trampoline which build file to use.
env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github/nodejs-docs-samples/.kokoro/appengine-datastore.sh"
}
53 changes: 53 additions & 0 deletions .kokoro/appengine-datastore.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/bin/bash

# Copyright 2018 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

export GCLOUD_PROJECT=nodejs-docs-samples-tests

export NODE_ENV=development
export GAE_VERSION=appengine-datastore-flexible

# 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
set -e;

cd github/nodejs-docs-samples/appengine/datastore

# Install dependencies
npm install

# Configure gcloud
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


# Deploy the app
gcloud app deploy app.flexible.yaml --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
npm test

exit $?