Skip to content

Commit

Permalink
Add deployment tests. Closes #21.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmdobry committed Nov 6, 2015
1 parent 5469269 commit 9d2d2fb
Show file tree
Hide file tree
Showing 5 changed files with 277 additions and 71 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
**/node_modules/**
npm-debug.log
coverage/
coverage/

test/encrypted/secrets.tar
test/encrypted/express-demo.json
test/encrypted/hapi-demo.json
33 changes: 31 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
sudo: false
sudo: required
language: node_js
node_js:
- "stable"
Expand All @@ -20,6 +20,7 @@ cache:

services:
- redis-server
- docker

env:
- PATH=$PATH:$HOME/gcloud/google-cloud-sdk/bin GOOGLE_APPLICATION_CREDENTIALS=$TRAVIS_BUILD_DIR/nodejs-docs-samples.json TEST_BUCKET_NAME=cloud-samples-tests TEST_PROJECT_ID=cloud-samples-tests #Other environment variables on same line
Expand All @@ -38,12 +39,25 @@ before_install:

- if [ ! -d $HOME/gcloud/google-cloud-sdk ]; then
mkdir -p $HOME/gcloud &&
wget https://dl.google.com/dl/cloudsdk/release/google-cloud-sdk.tar.gz --directory-prefix=$HOME/gcloud &&
wget https://dl.google.com/dl/cloudsdk/channels/rapid/google-cloud-sdk.tar.gz --directory-prefix=$HOME/gcloud &&
cd $HOME/gcloud &&
tar xzf google-cloud-sdk.tar.gz &&
printf '\ny\n\ny\ny\n' | ./google-cloud-sdk/install.sh &&
source /home/travis/.bash_profile &&
cd $TRAVIS_BUILD_DIR;
fi
- gcloud components update -q
- gcloud components update app -q
- openssl aes-256-cbc -K $encrypted_4e84c7c7ab67_key -iv $encrypted_4e84c7c7ab67_iv -in test/encrypted/secrets.tar.enc -out test/encrypted/secrets.tar -d
- if [ -a test/encrypted/secrets.tar ]; then
cd test/encrypted && tar xvf secrets.tar && cd ../..;
fi
- if [ -a test/encrypted/express-demo.json ]; then
gcloud auth activate-service-account --key-file test/encrypted/express-demo.json;
fi
- if [ -a test/encrypted/hapi-demo.json ]; then
gcloud auth activate-service-account --key-file test/encrypted/hapi-demo.json;
fi
- openssl aes-256-cbc -K $encrypted_95e832a36b06_key -iv $encrypted_95e832a36b06_iv -in nodejs-docs-samples.json.enc -out nodejs-docs-samples.json -d
- if [ -a nodejs-docs-samples.json ]; then
gcloud auth activate-service-account --key-file nodejs-docs-samples.json;
Expand All @@ -55,3 +69,18 @@ install:

after_success:
- npm run coveralls

before_deploy:
- cd appengine/express
deploy:
- provider: gae
keyfile: test/encrypted/express-demo.json
project: express-demo
config: appengine/express/app.yaml
default: true
version: demo
docker_build: local
on:
repo: GoogleCloudPlatform/nodejs-docs-samples
all_branches: true
node: stable
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"googleapis": "~2.1.3"
},
"devDependencies": {
"async": "^1.5.0",
"coveralls": "^2.11.4",
"istanbul": "^0.4.0",
"jshint": "~2.8.0",
Expand Down
Loading

0 comments on commit 9d2d2fb

Please sign in to comment.