-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Instructions for setting SYMFONY_ENV on Heroku #4591
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
looks good to me |
Wanna merge it? And where do you think general docs on that env var should go?
|
I'm not a member of the doc core team. I don't have merge rights on this repo |
@dzuelke thanks for this nice improvement and for documenting the You are right about the necessity of documenting more these variables (there is an opened issue related to this: #4162). However, as this is a quick fix for Heroku, my proposal for doc managers (@weaverryan, @wouterj and @xabbuh) would be to merge this PR right away and keep #4162 open to discuss more about where and how to document these variables. |
correct settings. After you've done that, you can simply ``git push`` and | ||
you're done! | ||
correct document root. After that, you will ensure that your Symfony application | ||
runs the ``prod`` environment, and then you'll be ready to ``git push`` to |
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.
Our standard is to not use Oxford commas.
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.
But this is a subordinate clause, not a list of items, no?
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.
I'm actually not completely sure. Maybe our native speaker @weaverryan can make it clear.
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.
@dzuelke what do you mean by:
you will ensure that your Symfony application runs the
prod
environment
I mean, does the user need to do something here? Or do we just mean, double-check that things are ok when you go to app.php
locally, just to be sure first? I'm just not sure myself, so I want it to be clear for others :)
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.
Bah, nevermind - now I see the next section... - let me read the rest
I only see some minor issues. Besides that 👍. |
Is this ready for a merge, @weaverryan ? |
This PR was merged into the 2.3 branch. Discussion ---------- Instructions for setting SYMFONY_ENV on Heroku Much smoother sailing with that step included :) On a related note, I was going to add general advice on using `SYMFONY_ENV`, as it is currently very under-documented (just one aside mention at http://symfony.com/doc/current/cookbook/deployment/tools.html#c-update-your-vendors), but I wasn't sure where to do this. Maybe in `cookbook/configuration/environments.rst` and a few other places? Commits ------- 576bbfb remove first person as per feedback 579fdd6 capitalize section title as per feedback 5f987ff instructions for setting SYMFONY_ENV on Heroku for smooth deploys
Hey David! Merged! Thanks for this - I really want the Heroku instructions to be rock solid :). I created a follow-up PR with some minor formatting things - see #4601. We still have #4217 open, which has some Heroku-deploy issues and discussion. In particular, I'm personally still unclear how parameters.yml should be handled. As you see on that issue, you can use the Thanks! |
@weaverryan the env-map feature of Incenteev/ParameterHandler has been implemented precisely to be able to provide the parameters through heroku config vars to build the parameters.yml (which is still ignored in the git repo) (disclaimer: I'm deploying my Symfony app on Heroku since 2 years at work). |
@weaverryan In
to read env var |
Mind you that there is a caveat though with both this approach and a However, it is possible for env vars to change, either because the user changes them (through In that case, an empty Git push would have to be made to restore the app to working order. I started looking into generating a |
@dzuelke I'm planning to try writing a bundle hooking into the container to change some service arguments to be retrieved dynamically from the environment at runtime (with a fallback to the configured parameter), precisely to support the case of Heroku Postgres HA plans. I will give you some feedback in a few days after my experiments. |
@stof My super crude approach to hack it in was this (the |
your approach will be broken, because lots of strings can be callables. |
Yeah, could also check for |
Did you push your work somewhere publicly? :) I'm curious! |
@dzuelke not yet. It is still in progress. I will open-source it this evening hopefully, or in the coming days (depending of how much time it takes me to have the initial version working). Watch new repos appearing on https://github.com/Incenteev/ |
@dzuelke here it is: https://github.com/Incenteev/DynamicParametersBundle |
This PR was merged into the 2.3 branch. Discussion ---------- [Heroku] A few more tweaks to outline the steps | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.3+ | Fixed tickets | n/a Hey guys! This is just a tweak to #4591 - it's just a minor organizational thing so that (hopefully) it's even more clear what 3 steps you need to take. Thanks! Commits ------- 8c7e3b2 Changing to #. format 4ee7cef A few more tweaks to outline the steps
Much smoother sailing with that step included :)
On a related note, I was going to add general advice on using
SYMFONY_ENV
, as it is currently very under-documented (just one aside mention at http://symfony.com/doc/current/cookbook/deployment/tools.html#c-update-your-vendors), but I wasn't sure where to do this. Maybe incookbook/configuration/environments.rst
and a few other places?