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
"Configuration and environments", configs of team members #120
Comments
Yes, this part could be elaborated. |
Is the Lets say there are 10 team members. Lets say everyone of them uses their own version of Now lets say 5 out of 10 team members use one
So basically you as a team member must store somewhere separately your own |
Noone's. A common template for development should be there.
Usually it's doing |
This is how I use environments: I usually have my test site on OpenShift or some other cloud host. This is so I can show it to the client without risking anything. On a fresh Yii2 Advanced install, I go straight to the environments directory. I put in my local db info into the "dev" directory. I put my OpenShift db config variables in the "prod" directory. I then run When you init into development mode, it copies the When I push to OpenShift, I have it init into production mode. Which copies the environments "prod" files live into the site for use. Thus, it knows how to use my OpenShift server (db). Say you have a co-worker on the project too. In the
When Steve runs init, it will copy his own directory live into the site. This is so he doesn't have to waste time setting up his db and other settings every single time. You could use
When the project is done, you push it to Amazon. |
It's not advised to store production credentials in the repository. |
Your right, and I don't. I should have been clearer. They are environment variables, not the actual credentials. And the repos aren't public on github anyways. In my case, I have hooks set so when I get push, it automatically runs composer and init on the server. With cloud hosts like OpenShift and Heroku, it's a pain to do much on the server end just to run init. So those credentials need to be in the repo so they are pushed. They are usually env vars like:
|
Ah. OK. That makes sense for your environment. env vars are good in case you're running a single project per server or container. If not, it's better to stick to files. |
So this exact issue has been puzzling me and my team and we were wondering what would be considered a best practice approach with the current environment system as it is. The use case is: How should this new config change be distributed among the team members? If I add the new component to I would like to hear your thoughts on how you solved this issue. |
Add it to normal config file within environments. |
Wouldn't that require the developers (which have already cloned the project) to run the init script again? This will cause them to lose their local changes made in the |
Yes. That would require to run |
Can you please explain? How would the changes in |
As I said, you won't change |
Thank you for your help. What we ended up doing (if anyone reading this is having the same issue) is adding two new configs, |
Yes. That's what I'd do as well. |
Did you mean |
@PowerGamer1 right, I meant |
What about switching to |
Then what is the recommended way to deploy production config in case of update? Production should have its own *-local files right? And it is also not recommended to keep production config in any vcs, so the config shouldn't be in main config files, shouldn't be also in local dev files, production config should be on production local files only? |
Solved by 7cfbb6d |
For this case, I think Yii2 should implement .env as Laravel did. |
"Configuration and environments" doc states that
yii2-app-advanced
template somehow solves the problem of different team members having different-local.php
configs underdev
environment. But all-local.php
configs go underenvironments/dev
folder which is commited in its entirety (since there are no.gitignore
files forenvironments
folder or inside it). So it is unclear where does each team member keep his copies of-local.php
configs and how and when (before or after or duringphp yii init
) that team member's copies of-local.php
configs are copied into final project folders.The text was updated successfully, but these errors were encountered: