[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ruby runtime force production environment #420

Open
1 of 6 tasks
lukasztackowiak opened this issue Jun 12, 2024 · 2 comments
Open
1 of 6 tasks

Ruby runtime force production environment #420

lukasztackowiak opened this issue Jun 12, 2024 · 2 comments
Labels
kind/bug Something isn't working

Comments

@lukasztackowiak
Copy link
lukasztackowiak commented Jun 12, 2024

Currently Ruby runtime force production environment here and here.

With such configuration it is impossible to precompile assets in staging environment if application is using per-environment Rails credentials and you won't provide a key for production environment (which obviously shouldn't be done on staging environment).

It'll be much better if RAILS_ENV can be provided through build_env_variables and set to production only if the variable will be empty or not set at all.

Additional context
How are you using GCP buildpacks?

  • pack and the gcr.io/buildpacks/builder
  • Cloud Functions
  • Cloud Run
  • Cloud Build
  • App Engine Standard
  • App Engine Flex

What language is your project primarily written in?
Ruby

@lukasztackowiak lukasztackowiak added the kind/bug Something isn't working label Jun 12, 2024
@matthewrobertson
Copy link
Member

This is reasonable, but I think we should separate the runtime environment variable from the build environment variable. I suspect (but I am not sure) that it is should already be possible to override the runtime environment variable by providing it in app.yaml. I believe app.yaml should take precedency over LaunchEnvironment.Default which is what we use here.

@lukasztackowiak
Copy link
Author

@matthewrobertson That is correct, the variables set by LaunchEnvironment.Default can be overridden by setting environment variable so this is only a bit misleading (that runtime has a hardcoded production value).

Unfortunately assets precompilation process happens during the building time and have explicitly hardcoded RAILS_ENV=production (here) that cannot be overridden in any way (or at least I have no idea how to do it) so this is the main problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants