-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[HttpKernel] add kernel.runtime_environment
= %env(default:kernel.environment:APP_RUNTIME_ENV)%
parameter
#38543
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
Conversation
Why not |
5cd483f
to
3131e20
Compare
Because it's shorter and equally descriptive to me. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
another advantage: developers can use APP_RUNTIME_ENV=prod ./bin/console secret:set
to define secret in "prod" environment without needing to build and boot a "prod" containers. It avoid booting tools like "newrelic", "sentry", ...
…environment:APP_RUNTIME_ENV)%` parameter
kernel.runtime_env
= %env(default:kernel.environment:APP_RUNTIME_ENV)%
parameterkernel.runtime_environment
= %env(default:kernel.environment:APP_RUNTIME_ENV)%
parameter
3131e20
to
6eb9d62
Compare
Thank you @nicolas-grekas. |
This PR was merged into the 5.2 branch. Discussion ---------- [secrets] Use APP_RUNTIME_ENV to define secrets Use new env variable introduced in symfony/symfony#38543 to define secrets. /cc `@nicolas`-grekas Commits ------- 9994e7b Use APP_RUNTIME_ENV to define secrets
Instead of #37584
This PR adds a new
kernel.runtime_environment
parameter, which creates a convention to use theAPP_RUNTIME_ENV
env var to define the name of the runtime environment where the app is deployed.When this env var is not set, the parameter defaults to
kernel.environment
.This is especially useful for defining the location of the vault for secrets: an app can be deployed in "prod" mode, but still not be deployed on the real prod deployment target. When this happens, one might not use real prod secrets but instead, use a vault with creds for staging.
This parameter enables this use case.