Getting started with BLT

Acquia BLT is a Drupal development and deployment tool. It basically mimics a continuous integration system, but runs locally. I'm hoping to use it to upgrade our development process and achieve these benefits:

  • Remove compiled assets and dependencies from the repo to reduce merge conflicts.
  • Automatically check code formatting and run tests.

 

Here are the docs to get you started: http://blt.readthedocs.io/en/latest/

 

Out of the box, you're set up with pre-commit and commit-msg git hooks.

The commit message hook only allows merge commits by checking the commit message. This is to prevent you from committing directly to the master branch - you must follow a development workflow.

The pre-commit hook is set up to lint the code being committed. On my first try with this, it flagged jpg and png files for not having an empty line at the end. I bypassed this by using -no-verify n in the commit, which specifically bypasses these 2 hooks.

Before I can use BLT on a project, I need to map out the workflow a bit further. We can create a separate repository for the team to work with, and I can run BLT locally to merge into the site repo. However, that doesn't force other developers to lint the code before I see it.

Tags
DevOps