Default template

Deploying Library: Google App Engine

By NYT Library Demo.

Created .

Library can be deployed using many configurations, including Docker, Heroku, and Google App Engine. Note that to deploy to Google App Engine you will need to enable billing on your GCP account.

To deploy to Google App Engine, start by cloning the Library repo locally

git clone

Create a new file in the repo you just cloned:

cd library
touch .env

Set your environment variables, including the CUSTOMIZATION_GIT_REPO variable, if using. The link to the customization repository should be the HTTPS cloning URL, not the SSH URL. For example:

DRIVE_TYPE=**team | folder**
PATH_PREFIX=**Optional path prefix for your site. Remove if Library is hosted at the root.**

Note that the values above surrounded by **asterisks** are placeholders and you should replace them with the values specified by the previous setup steps. You can test whether or not your .env file will work by running source .env in your terminal to confirm that it does not error. If the file is valid, you will not see any output and the environment variables will be available in the current shell. For instance:

Your google application JSON must be on a single line. If you’re still having API authentication issues when trying to boot the app, you may need to wrap it in single quotes.


would print the value listed in the .env if your file is written correctly.

Before proceeding, you should make sure to enable the Cloud Build API on your GCP project. You can find it under the APIs and Services menu in the GCP console.

After enabling the cloud build api, you should be able to go back to your terminal and run:

gcloud app deploy --project=**your_project_id**

If the deploy succeeds, you’ll see some output ending in:

Setting traffic split for service [default]...done.                                                                                                 
Deployed service [default] to [https://**your_project_id**]

You can stream logs from the command line by running:
  $ gcloud app logs tail -s default

To view your application in the web browser run:
  $ gcloud app browse --project=**your_project_id**

Navigate to your app's url listed above and enjoy your Library app!