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

Use VAPOR_ENV for non-standard environment option #176

Merged
merged 1 commit into from
Mar 19, 2024

Conversation

joelvh
Copy link
Contributor

@joelvh joelvh commented Mar 18, 2024

Vapor lets you set up multiple environments, each with its own name. While they are different environments, they may all still run in "production mode" with APP_ENV=production. But the encrypted environment variables each Vapor environment needs will be different.

The issue is that the naming convention of .env.production.encrypted in the root of the repository does not allow for storing encrypted environment variables for multiple Vapor environments that run in production mode.

This PR introduces VAPOR_ENV to mirror the environment name used for each Vapor environment. (In our case, we use dev, demo and production -- sometimes staging.) FWIW we use STAGE as the environment variable to distinguish environments, but VAPOR_ENV would be less opinionated.

Copy link
Contributor

@joedixon joedixon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I think this looks like a good solution.

@joelvh
Copy link
Contributor Author

joelvh commented Mar 19, 2024

Thanks @joedixon!

Is there a way to reference the Vapor environment name currently, that might populate this automatically? Or maybe set the preference for Vapor vs. Laravel environment name to be used?

Either way, this solution works for us!

@joedixon
Copy link
Contributor

@joelvh the only place we populate Vapor's environment name is in APP_ENV, but if you override that, it's not available any longer, so I think this is a good option.

@taylorotwell taylorotwell merged commit 91faaf8 into laravel:2.0 Mar 19, 2024
23 checks passed
@joelvh
Copy link
Contributor Author

joelvh commented Mar 19, 2024

Ah, that's great to know! Didn't realize that's where it is set by default. I'm happy to update the docs if you can point me to them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants