Skip to main content

BLT is Acquia's CLI tool that helps build and deploy Drupal applications easily. You can use it for non-Acquia hosted projects as well and it makes Drupal DevOps so much easier. 

For those using VMs and docker for local setup, it can be hard to get the blt command to work without ssh-ing into the VM or docker container. 

Firstly, how does ddev commands work. Ddev stores all configs and everything required to run ddev in the .ddev folder. Which is where the config.yaml file is also. If you look closely, there is a folder named commands. This folder is where the the ddev commands are. You can also find the commands provided by default in the .global_commands folder.

So now all you have to do is create a file called blt and put the following contents into it.
 

#!/bin/bash

## Description: run blt in the web container
## Usage: blt [flags] [args]
## Example: "ddev blt setup" or "ddev blt tests"
## `ddev blt source:build`

/var/www/html/vendor/acquia/blt/bin/blt "$@"

 

To automate creation of this file when doing ddev start, simply create a file named blt.example in the .ddev folder and make sure its not ignored in git. Then add the following to the post start section in the config.yaml file.
 

hooks:
  post-start:
  - exec: cat /var/www/html/.ddev/blt.example > /var/www/html/.ddev/commands/web/blt
      && chmod +x /var/www/html/.ddev/commands/web/blt

 

x

Work

Therefore logo
80 Atlantic Ave, Toronto, ON Canada
Email: hello@therefore.ca
Call us: +1 4166405376
Linkedin

Let us know how we can help!