CMS driven websites are harder to manage through version control systems due to the fact that configuration is stored in the database and not in the code. All those menus, pages, pieces of texts in the header and footer, etc – all are stored in the database.
On some mid-sized projects we utilize following approach:
-
we have WordPress CLI installation script, which performs WP setup and configuration as well as populates database with all posts, menu configuration, theme configuration, etc, etc
-
this script is maintained in the Git repository of the project as well as all other code.
-
this script is launched on CI server each time tests are launched, to keep CI version of content up to date
-
this approach is used until website is launched. After launch – client admin will use WP admin panel to maintain content.
Cons:
-
this approach has some effort overhead, because making changes in CLI installation script is a bit more complicated then making changes in WP admin panel
-
when client would like to change some information himself before site is launched – we have to merge his changes back to installation script
Pros:
-
fully-functional CI server with good content, see Recording videos on CI server
-
until launch content is under version control, which is good.
-
setting up development environment, stage and live servers is much easier and quicker