-
-
Notifications
You must be signed in to change notification settings - Fork 607
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
Can we work on a better way of keeping a full trellis build under git? #883
Comments
@tangrufus You have been doing some great work recently, any ideas? Or how did you setup your project(s)? |
> How did you setup your projects?More less the same as the
$ git clone -o roots https://github.com/roots/trellis.git www-example-com-trellis
$ cd www-example-com-trellis
$ git remote add tangrufus https://github.com/tangrufus/trellis.git
$ hub create -p
$ git remote -v
origin https://github.com/TangRufus/www-example-com-trellis.git (fetch)
origin https://github.com/TangRufus/www-example-com-trellis.git (push)
roots https://github.com/roots/trellis.git (fetch)
roots https://github.com/roots/trellis.git (push)
tangrufus https://github.com/tangrufus/trellis.git (fetch)
tangrufus https://github.com/tangrufus/trellis.git (push)
## Merge my project temaplate
$ git fetch --all
$ git merge tangrufus/project-template
## Do your job...
## Commit and push to `origin` as usual
## When roots/trellis has been updated...
## Important: Reading change logs, commit messages and `git diff` are necessary
## Tips: Make use of git branches
$ git fetch --all
$ git merge roots/master Do I recommend everyone to use this method?No. Use it only if you are comfortable with Should you always keep your forks update with roots/trellis?Yes! Always! However, updating Trellis is challenging, I don't think of a good and easy way that suitable for everyone. Edit: By forks, I mean both Avoiding merge conflictsSince I use Tips:
Let say you want to change something in
|
And just to confirm you create a second repo just for bedrock and the
actual WP related stuff?
|
Correct. For every project, I have 2 git repo:
You need to change trellis/group_vars/production/wordpress_sites.yml Lines 12 to 13 in db89d49
|
If you make changes to Trellis as @tangrufus outlined, merge conflicts and overwritten local changes shouldn't happen too much. One thing which I don't know has been mentioned on on Discourse is specifying merge strategies for specific sub paths. So if you know that
|
We definitely need some guides/docs about:
|
I believe it is `-X ours` not `yours`, I'll definitely follow Tang's plan
in the future, it'd probably be a headache for my pre-existing ones.
|
Correct, updated it |
@tangrufus Hey Tang, I've almost wrapped up a setup according to your specs, except I'm stuck on a I feel like browser caching should be added into Trellis and enabled when we enable |
We can't really do that automatically. Just because you enable fast-cgi caching doesn't mean you have a proper setup with asset digests. |
Super sorry @swalkinshaw I was just reading other the tickets about browser caching, forgot that you have some concerns with browser caching. |
Couldn't we make a "child config" from the base roots config? |
@tangrufus I've been using your method for a current project and it works great. Two notes though. It can be slightly simplified by your project's trellis having two remotes not three, one being origin and the second being your user's trellis. You would just keep project-template up-to-date and rebase off of that instead of roots remote. And the second one is a question. Any idea how to keep bedrock up-to-date without having to deal with merge conflicts for composer.lock? |
You don't. First resolve conflicts in |
Yup that's what I do. I know it's best practice to keep composer.lock in
vc, but I wonder if it'll work fine without it being in vc. Especially
since it's wp packages and not anything with other Composer dependencies.
On Sun, Dec 3, 2017, 7:01 PM Tang Rufus ***@***.***> wrote:
deal with merge conflicts for composer.lock?
You don't. First resolve conflicts in composer.json, then $ composer
update. Let composer generate a new composer.lock for you.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#883 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ACbIG0vR9isVNOYp62U5IAn_8HuayeBmks5s82CMgaJpZM4PSJjF>
.
--
Thank you,
Patrick Artounian
|
It works without ReasonTrellis runs WorkaroundIf you really want to exclude RecommendationCommiting your See: |
Yup, that is what I thought. I actually always specify the exact version, as not all minor versions can be without breaking changes. |
To avoid unintentionally upgrading packages, use |
Thank you for laying out your personal method of updating trellis. Can I ask what is the benefit you see in having bedrock and trellis in two different repositories? For updating trellis it’s a simpler git operation, but beyond that? Plus, unless I have it set up wrong, the virtualenv isn’t operational inside the bedrock directory when I set it up in two repos. I love the idea of keeping a set of customisations in a branch of a fork, and keeping it up to date. I will be doing this with bedrock also. Are you still doing it all this way? Any changes/improvements you could mention? Thank you. |
@robrecord: My two cents here: Bedrock-sites are made to be like 12-factor apps, with configuration, data, etc cleanly separated. |
@strarsis - thank you for adding these considerations. Absolutely, I agree with this. It does seem like a there could be a natural possibility for separation here. The thing that is bringing me back is that my trellis instances only ever reference one site, and as such are configured only for that site. They would not be useful for any other. So while the bedrock instance can exist without the trellis instance, it is not the case the other way round. Plus trellis is used to generate the .env file (though not strictly necessary). Thus, while the separation is possible, the two also seem to belong together in one repo and it feels unnatural to maintain a separation. If my resistance ends up being purely about semantics then maybe I need to give it up and try the two separate repos again, but I'd like to be fully aware of all the practical benefits. |
Simpler git operationsWith the roots/trellis and my trellis fork as the git remotes, updating with roots or my common customizations is just 1 However, if your team knows git well enough, using the git subtree way could also achive the same goal. No need to give away server side stuffs to 3rd party developersThere are times we hire freelancers to do one-off tasks. In those cases, we don't want them to see the trellis repo because they have no need to change server side stuffs nor to know what's in Besides, when clients leaving us, we could just handover the bedrock repo to the new devlopers. 1 less document to write because:
Bedrock sites can also be hosted on non-Trellis servers
I stand with the idea of "unless your team has experts in all of DevOps, database, linux, security, nginx, redis/memcached, and every other tools WordPress servers might use, don't host clients' websites yourself." As I am using Kinsta, only the deploy part of Trellis is in use. If a better deployment workflow come along, I might just ditch Trellis. |
Thanks for the detailed reply, @tangrufus ! The second point, I hadn't considered. |
Submit a feature request or bug report
Replace any
X
with your information.Of course there is the roots discourse thread from December, but it has issues in different ways, either overwrites local changes or creates merge conflicts for every single change. I imagine other people have issues also, I think we should come up with a solution to his issue with the subtrees.
The text was updated successfully, but these errors were encountered: