GoogleCloudPlatform / elixir-runtime

The community-supported runtime for Elixir on Google App Engine.
https://cloud.google.com/elixir
Apache License 2.0
180 stars 14 forks source link

Support for custom MIX_ENV? #7

Closed stephanos closed 6 years ago

stephanos commented 6 years ago

👋 I'd like to use staging for my staging deployments since they use different settings, but it seems MIX_ENV is fixed to prod. Is there any way to change that?

dazuma commented 6 years ago

App engine lets you set environment variables in the app.yaml file; you can set MIX_ENV there. That would look something like:

env: flex
runtime: gs://elixir-runtime/elixir.yaml
# ...other settings...
env_variables:
  MIX_ENV: staging

Looking over the code, however, I realize that when building an OTP release, the env is hard-coded to prod. So the above will work if you're deploying without creating a distillery release, but if you're deploying a release_app, it's currently stuck on prod. I'll look into fixing that in the next day or so.

stephanos commented 6 years ago

thank you for the quick response and thorough explanation! yes, in my case I'm building a distillery release (that's the recommended approach, right?).

dazuma commented 6 years ago

Yes. The runtime doesn't require that you use Distillery, but it is a recommended best practice.

I'm testing a fix locally right now. I should be able to push it out sometime tomorrow.

stephanos commented 6 years ago

Fantastic. Thank you!

dazuma commented 6 years ago

New runtime is pushed out as of 12:30pm PST.