A Drupal 8 DevOps-Based Workflow: Deliver Your Drupal Projects Faster, With No Compromise on Quality

Faster project starts, faster development cycle, faster (and reliable) delivery, enhanced scalability and security, higher quality, better collaboration, happier clients... And the list of benefits that you can “reap” from implementing a Drupal 8 DevOps-based workflow is an endless one.

And best of all: these benefits are no longer restricted to certain... scenarios. For, let's face it:

The old constraints — that you should have an enterprise-sized team (or a dedicated DevOps team) worth the financial effort or a significant project budget — don't stand anymore.

They're an old “myth” that, meanwhile, has been busted...

Are you working on a small software development project using Drupal? Do you have a shoestring budget, maybe?

It makes no difference:

You can still adopt (at least) the basic best practices for incorporating DevOps into your Drupal development workflow.

And I'm talking here about:

  • having dedicated staging and development environments
  • putting together a solid system made of each team member's local development environment
  • frequent database downloads and imports from production
  • frequent clones of files back to staging or development environments
  • setting up a Git-based workflow
  • automated deploys after each fix or newly added feature
  • frequent Git pulls from development
  • manual deploys to a staging server for more testing and QA
  • manual deploys to the production server

Operational efficiency is key to Drupal modern development. And this is precisely the goal behind the DevOps model or better said “culture”.

 

1. But What Is DevOps? And How Does It Work?

Is it a workflow, a set of tools, a set of best practices? Or is it some sort of a framework?

DevOps is more of a culture. Or a disruption in the old IT culture, if you wish.

One that:

  • bridges the gap between developers and the operations/IT teams to save valuable time and speed up projects' development cycles
  • advocates for dynamic and efficient operations
  • … for lean and agile practices

The whole model was designed with 2 key goals in mind:

  1. rapid (and secure) delivery
  2. a good collaboration between the development and the operations teams

Basically, teams that apply a DevOps approach to their software development projects are seen as “wholes”. As unified teams and not as “infrastructures” of cohabiting teams — development and operations:

From development to testing, to deployment, both developers and operation professionals work together as one team.

Now, getting back to “defining” DevOps, here are the 3 “pillars” of a solid DevOps strategy:

  1. continuous delivery
  2. automated testing
  3. continuous deployments

     

2. Drupal 8 DevOps: Automated Testing & Continuous Integration

You might have already used Devops for Drupal, to optimize your Drupal development workflow, without even knowing it. Without putting a name on these practices.

Just think about it:

  • you adopted Composer-based workflow
  • … implemented automated testing
  • ...containerized your local development
  • … done continuous deployment

… for some time now, right?

Well, all the more, Drupal 8 seems to have been built precisely for supporting DevOps models.

From Drupal 8 continuous integration to Drupal 8 deployment and automated testing, the latest version of Drupal is ideally suited to support a robust DevOps-based strategy.

It's built for automation, which implicitly leads to:

Higher quality Drupal projects, delivered significantly faster.

 

3. Bringing DevOps into Your Drupal Development Workflow: Top Benefits

Just think of all the time you invest waste in:

  • testing Drupal modules
  • installing Drupal on a new system
  • making the due adjustments to your servers

What if you could simplify and streamline your whole development workflow?

You could be using Circle.CI, Probo.CI, Jenkins and/or other Drupal 8 DevOps tools for automating your tasks and tests and thus keep track of your patches and code.

But let's talk clear benefits, shall we?

What's in it for you if you implement all these DevOps deployment techniques and automation tools into your Drupal 8 development workflow?

 

3.1. You'll Speed Up Your Development Process

That's right, incorporating DevOps tools and best practices into your workflow will shorten the whole development cycle.

Drupal developers in your team will get to be more productive within the same budget, same timeline.

And it's only but predictable:

Just think continuous delivery and microservices; they'll enable your team to realease newly updated versions of your software products way quicker.

 

3.2. You'll Be Delivering More Secure Software

Drupal 8 DevOps doesn't mean compromising security for faster delivery's sake.

On the contrary.

Adopting this model will only enhance your project's security through a well-defined set of good practices and safety policies:

  • fine-grained controls
  • configuration management techniques
  • automated compliance policies

     

3.3. You'll Deliver Faster and More Reliably

“Convenience” is another word for DevOps.

Through continuous integration and continuous delivery, you'll practically put your release process on “autopilot” from build to... deployment.

Is there a bug to fix? A new feature to implement? Does the client require a certain change to be applied?

You can release updated versions of your Drupal-based software:

  • frequently
  • rapidly

And the quicker you'll manage to adjust the product to end users' growing needs and expectations, the bigger the advantage that you'll gain over your competitors.

Note: where do you add that you'll get to implement and to automatically test all the needed updates and upgrades in stand-alone instances...

 

3.4. You'll Handle Your Development Processes at Scale

And scalability is key in modern Drupal development.

By adopting a DevOps model you'll carry out all your development and infrastructure processes at scale.

 

3.5. You'll Deliver Higher Quality Drupal Project

In a DevOps model, faster development, delivery, and deployment don't mean sacrificing quality.

On the contrary:

Just think frequent automated tests before every single update is applied on live production content. Think repeatable builds and continuous deployments.

Integrating DevOps into your Drupal development process means that all module updates and changes made to your website/app get backed by several automated tests.

And that's what I call a solid quality assurance strategy.

 

3.6. You'll Improve Collaboration Within Your Team

And here I'm referring to:

  • the full transparency of the development cycles, that the DevOps model encourages; this way, each member of your team has access to any task to keep close track of its progress
  • the burden of all those repetitive, “mundane” tasks that DevOps takes off your developers' back; this enables them (and clients, too), to focus exclusively on value-adding features

     

4. Set Up a Basic Drupal 8 DevOps Workflow: 7 Steps

How would a basic “DevOps for Drupal” setup look like? One that fits any scenario, that doesn't depend on factors such as:

  • budget
  • used tools
  • hosting platform
  • the team's level of experience

What components — key processes, Drupal DevOps tools, Drupal deployment tools, best practices — would it include?

Here's an example:

 

4.1. A Pre-Configured Drupal 8 Install Profile

A Github-hosted one, that's mirrored on Packagist, as well.

Take it as a “basic kit” that will jumpstart all your new Drupal projects, providing your team with:

  • pre-configured content types
  • a working theme
  • Paragraph and Media bundles

All the needed “bare essentials” for getting your project up and running in no time!

 

4.2. A Solid Local Development Setup

A reliable local development setup is crucial if you consider a specific Drupal 8 DevOps context:

  • new and new features
  • bug fixes

… being frequently pushed from their local machines to Github.

A robust local development workflow will act as a solid foundation for this constant back-and-forth between the local environment and the production environment.

Note: you might want to consider leveraging Lando and Drupal VM for handling such repeatable processes.


4.3. A Git Repository

Automation is key, remember? And Drupal 8's been designed with automation in mind.

So, having your build code, custom modules and theme living on Github will just kickstart all your new Drupal projects:

With every pull request, the code stored there gets automatically deployed.

 

4.4. A Modern, Programmable Hosting Platform

Whether you choose Acquia or Pantheon or any other hosting platform, make sure that it supports automation and that it interacts with your continuous integration server.

 

4.5. A Continuous Integration Server: Circle CI

Every time a developer in your Drupal 8 DevOps team adds a new feature and/or fixes a bug, a new version of the project gets spun up and automatically tested.

 

4.6. Automated Functionality Tests

They do make a must-have component of any solid DevOps strategy.

How do they work?

Every time you push a commit, the full version of your Drupal project gets spun up on CircleCI, that would run a set of functionality tests (e.g. Behat tests).

If it passes these functionality tests, the continuous integration server delivers a new copy of your project.


4.7. Visual Regression Tests

It's quite similar to the previously mentioned step, except that here the Circle CI server runs visual regression and load tests, instead of functionality-focused ones.

It would let your team know if even just one pixel has changed between deployments.

 

5. Final Word

A DevOps strategy would have a too big impact on your Drupal 8 development workflow to consider it just a “nice thing to have”.

In the end, let us sum up some of the key benefits:

  • a more productive and collaborative team
  • faster project starts
  • reduced project timeline
  • faster delivery of the newly added functionalities
  • faster resolution to bugs
  • improved quality
  • overall more efficient operations

And, above all:

Happier clients...