Transforming a blogging platform into a real community initiative

June 26, 2023

Our blogging platform “Open Sourcerers” has grown to over 40 authors, all of whom share the same passion for open source technology. We believe that a community-based approach is essential, and everyone should have the opportunity to contribute to our platform. Until now, our focus has been solely on the content itself, but we have a vision for something bigger. We want to empower people to contribute to every aspect of our initiative. From designing and implementing new features for our WordPress powered blog to promoting our platform, we want everyone to have a say in how we move forward. The possibilities are just endless.

That’s why we came up with a set of use cases transforming a blogging platform into a real community initiative:

  1. Setting up the initiative for efficiency & scale
    1. Each individual’s voice counts, therefore the mission must be developed by the community
    2. There must be a small core team that owns and drives the initiative though
    3. We want everybody to easily become an author and/or contributor to the blogging platform
    4. Make the blog a self-driven & transformative community platform
  2. Establish an easy to use development workflow for the community
    1. Each contributor must be provided with a local development environment reflecting our live WordPress platform
    2. Contributors must be able to safely experiment with new ideas and development approaches. This could be changing the theme, adding new features to the site or similar
    3. Contributors should not deal with the complexity of integrating and deploying their changes
    4. Each change must run through version control & a review process
  3. Setup a continuous deployment for WordPress themes
    1. Reviewed and approved changes in the version control system must be automatically discovered
    2. Each change must lead to a fully automated deployment to our live WordPress platform
    3. Provide a reusable component to continuously deploy themes, since WordPress itself doesn’t provide an API for that.

How we implemented these use cases

Setting up the initiative for efficiency & scale

Efficiency and scalability are vital for any successful blogging initiative, that shall be supported by a larger number of people. The platform will only reach a self-sustainable and self-developing  state when smart people come together. The best ideas simply happen when teams are able to decide. Jim Whitehurst refers to this as “Letting the sparks fly” in his book “The Open Organisation”. 

We finally came up with a three step process:

  1. Call for volunteers: To kickstart the initiative, we reached out to our wider team (~50 persons) and called for volunteers who are passionate about open source and eager to contribute. We especially tried to recruit individuals who bring diverse perspectives and expertise.
  2. Ideate in multiple iterations: Engage the team in iterative ideation sessions to brainstorm ideas and identify strategies. Encourage open and collaborative discussions to gather valuable insights from each team member (we used Google Jamboard for this). We strived to leverage the collective knowledge and creativity of the team as much as possible.
  3. Craft a joint mission statement: Once the team had explored various ideas, the two initiators distilled them into a core concept and joint mission statement. In a second step we refined the concept through the course of multiple feedback iterations with the wider team. Finally this “architecture” now serves as our North Star.

A well defined content strategy is a must

To ensure a steady flow of informative and engaging content, a comprehensive content strategy has been developed. Our strategy is comprised of the following key elements:

  • Frequency: Publishing one article per week will help maintain a consistent presence and keep readers engaged.
  • Technical Collateral: The blog will offer a wealth of technical resources, including How-to Guides, Tutorials, Demos, and Quicktips. The content will be concise, yet comprehensive, enabling readers to quickly grasp and implement solutions.
  • Customer Stories: Real-world success stories from the field will be shared, providing insights into the practical applications of open source technologies.
  • Industry-Specific Content: we cover industry-specific topics (such as OpenADx, Digital Sovereignty, Open Insurance…) which will allow readers to gain insights into developments within their respective sectors.
  • Main themes and chief editors: To streamline content production and ensure quality, five main topics have been defined, with each topic assigned a chief editor. The chief editor’s responsibilities include recruiting authors, curating content, and overseeing the editing process. This approach helps distribute the workload across our wider team and ensures that each topic receives the attention it deserves.

This is fed into our main working document (=content plan) which you can see on the following screenshot.

Setup for efficient operations

Effective communication is vital for the success of this initiative. To facilitate this, regular content planning jourfixe meetings (we use a monthly cadence) will be held with the chief editors. These meetings will serve as a platform to discuss content ideas, coordinate publishing schedules, address challenges, and ensure a smooth workflow. 

Establish an easy to use development workflow for the community

As already described in the first section, our ambition is to provide each contributor with an easy way to contribute to the platform development. This includes customizations to the WordPress themes, adding new features and development of new plugins just to name a few use cases. Moreover our contributors shall have the opportunity to safely experiment with new ideas without having to deal with the complexity of provisioning the local environment.

We finally came up with an architecture relying on Git, GitHub, Ansible and Docker as outlined in the following screenshot.

The workflow is pretty straightforward:

  1. Make sure to install the following prerequisites: Ansible 2.14+, Docker Desktop 4.x
  2. Clone the self-contained GitHub repository (incl. themes, customizations, development tools, …)
  3. Start local development environment
    1. Start Docker Desktop
    2. Start the local dev environment
  4. Contributors can then login to their local WordPress and start development on the local clone
  5. Changes that shall go into production are simply committed and pushed to the master GitHub repository.
Bash
# Clone the self-contained GitHub repository
git clone [email protected]:sa-mw-dach/opensourcerers.git

# Start the local dev environment
ansible-playbook ./local-development/01-start-local-dev-environment.yaml

# Open browser at http://localhost:8080/wp-admin

Setup a continuous deployment for WordPress themes

WordPress is a very popular blogging and content management platform, powering millions of websites worldwide. While it offers a wide range of features, there are some use cases that aren’t directly supported by the platform. One such scenario is the ability to trigger theme updates within a WordPress container. However, with a little ingenuity and custom development, it is possible to overcome this limitation and enhance the platform’s functionality. Here’s a architectural overview of our implementation:

WordPress API Limitations

By default, WordPress does not provide a dedicated API to trigger theme updates within a WordPress container. This can be problematic for developers who require an automated and streamlined process for managing and updating themes. However, through custom development, it is possible to create a self-developed containerized API that can seamlessly handle theme updates.

Containerized API for Theme Updates

To overcome the lack of a built-in API, we created our own containerized API specifically tailored to trigger theme updates. This self-developed API is designed to communicate with the WordPress container, allowing for efficient and automated updates without manual intervention. By encapsulating the necessary functionality in a container, we have more control over the update process, ensuring compatibility and maintaining security standards.

JavaScript
app.post("/update_theme", (req, res, next) => {
        var request_ref = req.body.ref
        var request_repository_htmL_url = req.body.repository.html_url
        console.log(request_ref)
        console.log(request_repository_htmL_url)
        if(GIT_REPOSITORY == request_repository_htmL_url && GIT_REF == request_ref){
            execThemeUpdate()
            res.json(["Update","Successfull"])
        } else {
            res.json(["Update","Not successfull!"])
        }
   });

Another essential aspect of theme updates is the ability to provide compressed files for the update feature. So I created a custom API where the WP-CLI is able to download a compressed file containing the updated theme. This allows for efficient and secure updates, reducing the risk of errors and providing users with a seamless experience when updating their themes.

JavaScript
app.get('/download', function(req, res){
    const file = `${__dirname}/opensourcerers/twentytwenty-child.zip`;
    res.download(file); // Set disposition and send it.
});
Bash
## Fetch POD name via label
POD_NAME=$(/nas/content/live/open011prod/oc get po --show-labels | grep theme=update | awk '{print $1}')

## download file via curl cause of not existing web server to serve the file
echo "Download files at opensourcerers Pod"
/nas/content/live/open011prod/oc rsh $POD_NAME curl --output /opt/app-root/wp-cli/twentytwenty-child.zip theme-updater.opensourcerers.svc.cluster.local:8080/download

## install theme via wp
echo "install theme"
/nas/content/live/open011prod/oc rsh $POD_NAME /opt/app-root/wp-cli/wp theme install --force --activate /opt/app-root/wp-cli/twentytwenty-child.zip --path=/nas/content/live/open011prod/

Lastly it is necessary to establish a connection to the original WordPress Container via the OpenShift CLI tool, which is provided in my NodeJS container, to run the update process via the WP-CLI tool.

Webhooks for GitHub Repository Push Events

In addition to custom APIs, webhooks play a crucial role in enhancing the efficiency of WordPress development. By utilizing a webhook, I can track push events on GitHub repositories. This enables automatic triggers for various actions, such as deploying theme updates. By leveraging webhooks, developers can create a more agile and responsive development workflow, ensuring that updates and changes are deployed in a timely and efficient manner.

JavaScript
var request_ref = req.body.ref
        var request_repository_htmL_url = req.body.repository.html_url
        console.log(request_ref)
        console.log(request_repository_htmL_url)

Conclusion

While WordPress may have certain limitations regarding APIs and specific use cases, developers have the ability to overcome these hurdles through custom development. By creating self-developed containerized APIs, compressed file APIs for updates, and utilizing webhooks for GitHub repository events, the WordPress development experience can be enhanced, allowing for more efficient theme updates and streamlined processes. These custom solutions empower developers to tailor WordPress to their specific needs, ultimately leading to a more flexible and productive development workflow.

Transforming a blogging platform into a real community initiative

Over the last two years we have been constantly working on growing our blogging platform. With the approach described in this article we built up a vibrant and active community of 40+ authors in different regions! In addition to that we have set up a local development workflow  and created a fully automated update process for our contributors.

With these implementations we were able to shorten the time between commit and production to seconds and streamlined theme updates for our WordPress instance, improving the overall efficiency of our contributors!

What could be further improved?

  • Implement Review Process: Use feature branches & pull requests for code review and collaboration.
  • Utilize OpenShift Serverless: Optimize infrastructure and scalability, reducing costs and simplifying resource management.
  • Add Podman Desktop Support: Lightweight and secure containerization alternative, improving efficiency and compatibility across operating systems.

Leave a Reply

close

Subscribe to our newsletter.

Please select all the ways you would like to hear from Open Sourcerers:

You can unsubscribe at any time by clicking the link in the footer of our emails. For information about our privacy practices, please visit our website.

We use Mailchimp as our newsletter platform. By clicking below to subscribe, you acknowledge that your information will be transferred to Mailchimp for processing. Learn more about Mailchimp's privacy practices here.