This repo demonstrates how to deploy to Google Cloud from a Travis file and run an end to end test ( in e2e_test.py) against a staging environment.
See the managed_vms branch for a similar repo and Travis deployment using Managed VMs.
Travis has a builtin Travis deploy provider that can simplify your .travis.yml.
The main difference is that you no longer need to explicitly download the Cloud SDK and run the deploy command, although you still need to specify a service account credential.
To see an example, look at the following branches:
You can watch a screencast that walks through these steps with this repo here.
https://www.youtube.com/watch?v=7U4jjRw_AJk&feature=youtu.be
Note that the Books API Key is a specific requirement of this app, but is not generally necessary to deploy from Travis. The service account credential is always necessary, in order to authenticate the gcloud command line tool.
rm credentials.tar.gz.enc
travis login
travis encrypt-file credentials.tar.gz --add
git add credentials.tar.gz
git add .travis.yml
git commit -m "Add credentials and Travis changes
git push origin master
Copyright (C) 2015 Google Inc.