Deploying to Google App Engine with Travis CI

45 minutes
  • 4 Learning Objectives

About this Hands-on Lab

Travis CI doesn’t just let us automate the testing and release of our code — it can even deploy our code to production (or wherever you need to deploy). In this lab, we’ll take an existing Travis setup and add a deployment stanza to get our application working on Google App Engine, as well as configure GCP to work with Travis.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Enable Needed APIs
  • Enable 2 APIs on the Google Cloud Console:
    • App Engine Admin API
    • Cloud Build API.
Create App and Set Region
  • Create an App Engine app on the console. Only the region will need to be selected.
Create Service Role
  • Create a service role with the following permissions:
    • App Engine Admin
    • Cloud Storage Admin
    • Cloud Build Editor

(NOTE: Be sure to create and download the associated JSON key.)

Add Deploy Stanza and Deploy
  • Open the .travis.yml file and create a deploy stanza using an encrypted version of the JSON key and the project ID.
  • Commit code.

Additional Resources

You have finished writing a Travisfile that launches and tests your application, and now you want release it to the world via Google App Engine. Set up App Engine to create a service user to use with Travis. Then update the .travis.yml file to configure Travis CI to deploy to GAE on the main branch.

External Lab Setup

A GitHub account with Travis CI authorized needs to be used alongside this lab. While we provide the deployment environment, Travis CI is a fully hosted solution and needs to be used with your existing GitHub account.

Prior to beginning this lab, clone the contents of this repository ( to your workstation, then copy the forethought file to a new directory. Initialize a Git repository in this directory, and create a GitHub remote for it. Ensure Travis CI is authorized to work with the repository.

If you have taken the Building a Continuous Integration Pipeline with Travis CI course, use your existing forethought setup.

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?