P
P
Pavel Druzhinin2019-09-08 21:46:06
git
Pavel Druzhinin, 2019-09-08 21:46:06

How to work with GIT correctly if you have CMS projects?

Greetings, comrades!
I decided to switch to the git model, but there are certain difficulties that I can’t figure out how to solve.
The task is the following.
There is a site on a certain CMS, let's say ProcessWire, and you need to develop it with several people.
1. At the same time, I want to work through git, and so that it is uploaded to the production server when pushing to the master branch.
2. So that there is also a DEV branch that merges onto the dev server when pushing to the git.
3. so that you can write locally in docker containers.
4. In order for the git to have only the necessary information, the CMS itself is not needed in the git, in theory, only templates and modules are needed.
5. It is not clear what to do with assets. (Assets contain all sorts of files that, for example, users themselves uploaded to the site, or pictures for news, etc.) In theory, they should not get into GIT, but then it’s not clear how to synchronize everything between dev <-> prod <- > local for all developers and servers.
Advise what thread material, who works according to such or similar schemes on the development of sites (LARGE SITES that weigh more than a couple of hundred megabytes) while in a team, while it’s normal that I can write a piece locally, then push it to git, processed it there some CI / CD thread and it got to the devs, they looked at it, ran it in, and this piece ended up on PROD.
Thanks in advance!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
DevMan, 2019-09-08
@CrazyEnimal

1. build server + deployment system to taste
2. similar to point 1
3. no connection with the rest of the points
4. store only what you need in the git
5. you need to synchronize only assets that are directly related to the application (styles, scripts, icons, etc.) and they should be in the git. user trash is stored in a separate folder, which is simply linked when deploying to a project.

G
grinat, 2019-09-08
@grinat

1-2, but why two branches, if there is still a merge from dev to master
3, write, who is in the way? I don’t mind, I asked the earring (it’s a cactus), he grits, which he doesn’t mind either.
4 well, add it to gitignor, it would be nice if cms was loaded via composer, then the dependency would go as a vendor
5 them to gitignor, you have your own local copy, users have their own, they are not connected in any way. Considering that there are no migrations in cms, you can periodically merge database/file dumps. Jenkins does not recommend storing files in gitlfs
, gitlab is better, it is easier to set up, it has a built-in ci / cd, they have examples in the docks.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question