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.
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.
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"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With