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

Simplify build script #666

Merged
merged 2 commits into from
Jun 18, 2018
Merged
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
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 $?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do the node packages care about ending newlines?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably not.