Spinning up white label WordPress CMS for businesses faster -Part 2

Mohan Raj
News UK Technology
Published in
4 min readApr 12, 2021

--

Continued from Part 1

In this post, we will discuss in detail how we organise the capabilities, deployment workflow and CI/CD setup that helps to spin up CMSs faster.

Repository Management

All our capabilities like the plugins, themes are managed in separate repositories and any development related conversations are handled using PR’s. The required plugins and theme will be installed using composer configuration from the CMS repository. The NewsUK CMS repository is set up to sync with the VIP CMS repository which is used for code deployment.

This modular approach enables us to build, test and manage capabilities in isolation. It also makes the CMS repository stay light with just the list of required plugins specified in the composer file.

Repository management of WordPress Plugins, themes and CMS
Repository management of WordPress Plugins, themes and CMS

Unified deployment workflow

Within the typical WordPress folder structure, we are responsible only for the files inside the wp-content directory — i.e. the plugins, themes and necessary configuration files for a given site.

We have defined a workflow that enables us to:

  • Test the features in isolation
  • Ensure code is in sync in all environments
  • Simplify branching
  • Support multiple team contribution to the project

Our workflow encourages testing the feature in the local docker environment for every feature development. The Develop environment is used to perform system integrations and ensure everything works fine in VIP setup. Any feature can be deployed to develop environment by simply tagging the branch with the develop tag. The staging deployment is done automatically when a feature is merged to main. The production deployment requires approval in CI/CD build step.

Simplified development and deployment workflow
Simplified development and deployment workflow

Content Schema

As mentioned in Part 1, we are responsible for publishing the content data via a RESTful API.

The main challenge is to derive a content schema that is not only HTML friendly but also services the needs of other clients like mobile apps, web syndication, SEO requirements, etc. Using OpenAPI, we have designed our content schema using JSON API standards for defining the output produced by the CMS which our downstream systems can understand. This topic deserves a separate blog, so I’ll leave it here 😉 .

Standard CI/CD pipeline

At NewsUK we use CircleCI as our CI/CD tool which is a managed service. The pipeline that we built for our plugin and theme repositories consists of PHP, JS linting, and the associated testing jobs. The pipelines are set up in a way that all the jobs will run for every commit and should always pass to merge a PR. This setup gives us confidence that no breaking changes are deployed to the servers.

Here is an example pipeline workflow of plugin linting and testing jobs

Circle CI workflow for WordPress Plugins

Outcomes

White label CMS 1

The team spent 3 sprints (6 weeks) to complete all the capabilities that are covered in this 2 part series. These features can be reused to build a white label WordPress website with some out-of-box functionalities without any extra effort. We learned a lot and hit a few roadblocks during this expedition but it was time well spent and we were able to accomplish what we aimed for and met the OKR.

White label CMS 2

Based on the experience we gained in setting up the first white-label we managed to set up a new WordPress site for another business title in a matter of 2 weeks (1x engineer) 💪 . It includes a docker based local environment, composer based plugins, and themes, CircleCI pipeline with all standard linting and test jobs. We were able to reuse 2 plugins right off the bat that were created for the first project.

Next steps

The first project acted as a testbed to experiment with different techniques by adopting fail fast and learn approaches. The second project was more of a pilot run of what we built so far and acted as a proving ground to ensure we’re building things right.

The next step is to template the plugin and theme repo which can be easily used to create any new themes and plugins consistently. We want to create CircleCI orbs to automate the repeatable build steps for plugins and themes. These measures will help us to target our aspirational timeline to spin up any new white label CMS within a week. 🎉

Thank you for reading through our journey. We hope it is useful, feel free to share your thoughts or your personal experience in the comments below.

--

--