Building and maintaining a content management system for a high-traffic, public website is very challenging. Developers need to have a rational, safe and well-documented system for getting code from their local computer, into a testing environment, and then deployed to a production web server. For the UTC CMS Migration project, we have chosen a system built with technology supplied by Acquia, a software-as-a-service company that provides enterprise products, services, and technical support for the open-source web content management platform Drupal.
Local Development Environment
- Acquia’s BLT (Build and Launch Tool) is a set of scripts and configuration that help us set up a local development environment, write code locally, then test and verify that code before deploying to a hosting environment.
- Drupal VM is a virtualized Ubuntu Linux machine, configured to closely match the Acquia Cloud web hosting environment, so the code we write is compatible across all environments.
- JetBrains PHPStorm is our Internet Development Environment, the program that helps us write and manage the PHP and YAML code in our Drupal project.
Source Control Management
- Git is a distributed source control management system for tracking changes in source code during software development.
- A git “repository” (repo) is a software project, coupled with a history of every change to that software project.
- A git “commit” is a point-in-time, granular change to code, documented with a brief descriptive message describing the change
- A git “pull request” is a group of commits, and a developer’s request to integrate those commits into the software project
- Github is a hosted platform that facilitates collaboration between developers on software projects.
Developers work on a “forked” version of the main Github repository, and create a git “branch” for every new feature. A feature branch is “pushed” to the developer’s repo, and a pull request is made to review, test and pull the new feature into the develop branch of the main repo.
- Travis CI is a bridge between the main Github repository and the git repositories in Acquia Cloud, our hosting environment.
Bringing it all together
The connections between these systems are where the “magic” happens. We have built a continuous integration/continuous delivery system (CI/CD), using Acquia’s recommended tools and best practices.
Acquia’s recommended development workflow and tools
When we merge a new feature into the develop branch of our Github repo, Travis tests that code by:
- building a temporary web server
- installing Drupal
- importing codebase and configuration
- running tests to make sure the site is performing as expected
If the new code passes Travis testing, it is packaged and deployed to the Dev environment in Acquia Cloud, where it can be tested by human users. Similarly, we can test a new release by merging the develop branch into the master branch and Travis will test and deploy a new build to our cloud test environment. At that point, users can test new features and a release manager can deploy that code to the production environment as a new “version” of the CMS that end-users can access, view or edit, depending on their role.
Why this infrastructure and workflow is important
Using this system, every change a developer makes to the codebase is documented, tracked and tested multiple times before it goes to production. This may seem cumbersome to developers who are not familiar with a modern workflow, but it helps create:
- a codebase that can be worked on by multiple developers
- a software product that is well documented
- a workflow that is repeatable and consistent
- software that is continually improved, and works as expected