Do you know how a change reaches your live site?
Your website changes all the time. A security update comes out, a module needs updating, or someone needs a new field on a form. On many websites, only 1 person knows the steps that take a change to the live site, and someone checks it by clicking through the important pages. That's normal, and it works while the site is small and the same people look after it.
It starts to matter as more people rely on the site. Drupal security updates need applying within days. An upgrade is due and nobody can say what it will touch, or updates queue up because each release needs a day of manual checking. And when an application moves to the cloud, or the person who set up its servers moves on, it gets hard to say what production depends on.
DevOps gives every change the same tested path to your live site. Each change is built, checked and tested automatically, then deployed the same way every time, on the same setup from a developer's laptop to production. Every website we build gets this from the first commit, and an existing website gets it when we take over its support.
How we do it
DevOps brings 3 pieces of work together, and we set up as much of each as your site or application needs.
1. A CI/CD pipeline for every change
CI/CD stands for continuous integration and continuous deployment: every change is built and tested automatically, then deployed the same way every time. Ours starts from Vortex(Opens in a new tab/window), the open-source Drupal project template we've maintained for more than 8 years, on GitHub Actions or CircleCI. Your site gets a local development environment in Docker, the pipeline and a connection to your hosting.
Each change arrives as a pull request, a proposed change your developers can review, and the pipeline runs on it automatically:
- Drupal coding standards and static analysis
- A full build of the site, usually from a nightly copy of its database
- The automated tests, with a code coverage threshold of 90% by default
- A security audit that checks your PHP packages against published security advisories
- Visual regression with Diffy on the pull requests you label, comparing the changed pages with your live site
Once a change merges, it deploys to your development environment. Each release gets its own build for final testing, and it reaches your live site only when someone decides it should. On Lagoon, a production deployment backs up the database first. Your team hears about each deployment by email, Slack, Jira, GitHub or New Relic.
While we support your site, we keep the pipeline current. Renovate opens pull requests for dependency updates, the CI image and third-party actions are pinned to exact versions, and we bring in Vortex updates and fix the pipeline when it breaks.
2. Automated tests for what matters most
We start with the parts of your website your organisation relies on most, such as the forms that bring in enquiries and the tasks your editors do every day. We write those down as plain-English scenarios, and your team checks the list before we write the tests.
We use 2 kinds of test. PHPUnit(Opens in a new tab/window), the standard testing framework for PHP, checks the logic in your custom code piece by piece, such as the rule that decides who can edit a page. Behat(Opens in a new tab/window) tests the site the way people use it: it visits pages, fills in forms and checks the result. Each Behat test is written in Gherkin, a plain-English format where Given sets the scene, When is the action and Then is the result you expect. Here's a feature that checks news articles:
Feature: News articles
As a site editor
I want to publish news articles
So that visitors can read the latest news
Background:
Given the following article content exists:
| title | status |
| [TEST] Opening hours | 1 |
| [TEST] Draft newsletter | 0 |
Scenario: Visitors see published news
Given I am an anonymous user
When I visit "/news"
Then the response status code should be 200
And I should see "[TEST] Opening hours"
And I should not see "[TEST] Draft newsletter"
Scenario: An editor publishes an article
Given I am logged in as a user with the role "editor"
When I visit "/node/add/article"
And I fill in "Title" with "[TEST] New exhibition"
And I check "Published"
And I press "Save"
Then I should see "[TEST] New exhibition"
Most of the code behind those steps comes from Behat Steps(Opens in a new tab/window), our open-source library of ready-made steps for Drupal, and we write custom steps for anything unique to your site. When a test fails, the build fails with it, and Behat Screenshot(Opens in a new tab/window) saves the page as it looked at that moment. We fix tests that fail at random, keep browser tests to the journeys that need JavaScript, and run the suite in parallel as it grows.
3. Containers that run the same everywhere
Every application needs more than its own code to run: a language version, a web server, a database, a cache and settings that change between environments. Containers write that setup down as code, so the application runs the same way on a developer's laptop, in testing and in production. We containerise applications of any kind, from Drupal websites to services written in other languages, and set them up on Kubernetes(Opens in a new tab/window) or managed container services in AWS and Azure.
We start with what your application needs: its runtime, the services it depends on, its configuration and secrets, and how it's built and released. Then we write a Dockerfile for each part and a Docker Compose(Opens in a new tab/window) setup for local development, with passwords and keys supplied by each environment and kept out of the images. We recommend the simplest platform that meets your needs:
| Platform | What it suits |
|---|---|
| Amazon EKS(Opens in a new tab/window) | Kubernetes on AWS, for applications with several services that scale independently |
| Amazon ECS(Opens in a new tab/window) with AWS Fargate(Opens in a new tab/window) | Containers on AWS without a Kubernetes cluster to manage |
| Azure Kubernetes Service(Opens in a new tab/window) | Kubernetes on Azure, often where your organisation already runs on Microsoft's cloud |
| Azure Container Apps(Opens in a new tab/window) | Containers on Azure without a Kubernetes cluster to manage |
On Kubernetes, we package the application with Helm(Opens in a new tab/window), so each environment differs only in its settings. The pipeline builds new images, runs your tests in the same containers, pushes the images to a registry and replaces the running containers gradually, with rollback when a release fails its health checks.
What you get
Everything we set up lives in your code repository, beside the code it runs and checks, so it stays with you whoever works on the site next.
- The pipeline: the GitHub Actions or CircleCI configuration, which any developer can read and change.
- A matching local environment: Docker containers and a short set of commands, so a change behaves the same way on a laptop, in the pipeline and on your hosting.
- A test suite: Behat scenarios for your key journeys and PHPUnit tests for your custom code. The scenarios double as a plain-English record of how your site should behave.
- The container setup, where you need it: Dockerfiles, the Docker Compose file, and the Helm charts or service definitions for your platform.
- A handover: documentation, worked examples and a walkthrough with your developers and testers, plus our review of any tests your site already had.
Where we've done this
Automated tests and continuous integration are part of every website we build, from day one. Some examples:
- Vortex is open source, so its whole pipeline is public. Our own website runs on it, with its code and pipeline public on GitHub.
- We created Behat Steps and Behat Screenshot, and we maintain both as open source. Both ship with Vortex, and developers outside DrevOps contribute to them.
- We delivered Australia's first Docker-based government Drupal site, for the Victorian government, and took the same approach again for GovCMS.
- From 2018 to 2020, we worked with Salsa Digital on the DevOps for moving GovCMS onto an open-source container platform that runs on Kubernetes, including the automated workflow that moved its sites across, which we presented at DrupalSouth in 2018(Opens in a new tab/window). We also contributed to the GovCMS project scaffolds and their CI.
- In 2018 and 2019, a state government's whole-of-government content platform ran its CI on our CI image, now called ci-runner(Opens in a new tab/window), and its tests on 3 of our Behat libraries.
- We're building new Drupal 11 websites for 2 Melbourne community radio stations, with a digital agency partner. Both run Behat tests in parallel on every build, alongside PHPUnit tests for their custom code.
What it costs
How the work is priced depends on where your site or application is starting from.
| Where you're starting | How it's priced |
|---|---|
| A new website we build | Part of the fixed-price quote for your build |
| An existing website | An estimate up front, or a fixed-price quote for a defined scope, such as setting up the tools and covering an agreed list of journeys |
| Ongoing care | Part of your support plan, and test work can come out of your prepaid hours |
| Containerising any other application | An estimate up front, or a fixed-price quote for a defined scope |
A fixed-price quote is the price, and nothing starts until you've approved the scope and cost. For containers, the cloud running costs come from AWS or Azure on top of our work, and we help you estimate them while we choose the platform.
Test writing suits AI-assisted delivery. Hand-crafted or AI-assisted, your choice; the AI-assisted path comes in up to 30% lower on suitable work, for the same tested quality. Every test is still reviewed and has to pass in CI before anything is merged.
Where DevOps fits
A pipeline and tests are part of every custom website we build, and they come with our upgrade and migration work, where they show the site still does what it did before. The pipeline deploys directly to our hosting, and once it's running, support and maintenance keeps the pipeline, the tests and the base images current. If you'd like to know how well your current tests cover your site, a test coverage analysis is part of our in-depth site audit.
FAQs
Do we need automated tests before you set up a pipeline?
You can start without them. On a website we build, tests arrive with the first feature. On an existing website, the pipeline builds, checks and deploys the code that's there, and we add tests as we work on the site.
Can we control when changes go live?
Yes. Code reaches your live site only when a release goes out, and we agree the release process with you and write it into your project's documentation. On Lagoon, pull requests can get their own temporary environments for review, limited to the ones you label if you prefer. GitHub can require every check to pass before a change merges.
Which CI services and hosting do you work with?
The pipeline runs on GitHub Actions or CircleCI, with the same stages on each, so if your team already uses one, we'll use it too. Deployment to Acquia and Lagoon is built in, and Lagoon runs our hosting. Other hosting works when it can deploy from a git repository or a webhook and run Drupal's update steps after each deployment.
Do automated tests replace manual testing?
They take over the checks that repeat with every release. A person still looks at what's new, such as a fresh design or a connection to another organisation's system, and we include manual testing where a project needs it.
Which applications can you containerise?
Most applications that run on Linux, whatever they're written in, along with the databases, caches, search engines and queues they depend on. If part of your application is better left outside a container, such as a production database on a managed service, we'll tell you early.
Can you set up a pipeline for a site you don't build or support?
We set up pipelines as part of building or supporting a website, because a pipeline needs regular care for as long as the site runs. If your own team looks after your site, Vortex is free and open source, and its documentation walks through installing it on a new or existing project.
Do you use AI to write tests?
If you choose AI-assisted delivery, yes, and test writing is among the work it speeds up. Every change goes through the same pipeline and a developer's review before it merges, however it was written. Our responsible AI policy explains how we handle your code. We've written about what we put around AI-written code before it ships.