Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting up staging environment with Google App Engine

I've been able to set up a production environment with the App Engine but now I want to consider setting up a staging environment but this seems harder than I've expected.

To set up the prod env I needed to create an app.yaml file:

env: flex
runtime: gs://elixir-runtime/elixir.yaml
runtime_config:
    release_app: statcasters
beta_settings:
    cloud_sql_instances: statcasters:us-central1:statcastersproduction

This makes sense and is super easy but what about a staging env? How do I tell the app engine to deploy a different app? I'm not finding really any good documentation of this anywhere.

like image 637
Bitwise Avatar asked Apr 28 '19 14:04

Bitwise


People also ask

Is Google App Engine deprecated?

In Google I/O 2011, Google announced App Engine Backends, which are allowed to run continuously, and consume more memory. The Backend API was deprecated as of March 13, 2014 in favor of the Modules API.


1 Answers

I use the default app.yaml file to deploy to prod, and a separate app.staging.yaml file for staging.

To deploy to prod, I just run the normal deploy pointing to my prod project:

gcloud app deploy --project [prod-project-name]

To deploy to staging, I point to a separate staging project:

gcloud app deploy app.staging.yaml --project [staging-project-name]

Inside app.yaml, I use a environment variable to set the environment, eg:

env_variables:
  APP_ENV: "production"
like image 153
Ho-Wan To Avatar answered Oct 17 '22 17:10

Ho-Wan To