Lando + BLT + Acquia

By Geoff St. Pierre

December 09, 2017

Pro workflow with Lando, BLT, and Acquia cloud.

Introduction

Acquia BLT is the Acquia Build Launch Tool (BLT). It can be a paradigm shift for many Drupal developers, but the idea is that your production environment is an artifact of development. In brief, that is to say you need different things in your dev environment than what you need to run the production web application. BLT helps us embody this workflow by providing a build and deploy pipeline where we have all the tools we need and love in dev and with a simple lando blt deploy command the production artifact is generated, sanitized, and delivered to the Acquia Cloud. Awesome!

Init the Lando BLT Lightning App

Make a directory for your new app and cd into it. Then, use the lando init command to get going:

lando init -r drupal8

Edit the resulting .lando.yml file and add the tooling key. This will make Lando aware of the blt command inside the app.

Get a BLT Lightning App Codebase

Tell BLT about your Acquia Cloud app by setting the machine_name in the blt/project.yml file to match the machine_name of your Acquia app from the dashboard. Also, make sure to use the lightning profile by checking that the line name: lightning indicates the lightning distribution. It should by default, but if it does not you should change it.

Now that the database creds are set, we are ready to install the site. Run:

lando blt setup

During this step, drush will output a random username and password. Make note of those so you can use them to login to your new site, or you can login with lando drush uli to generate a one-time login link.

Pro Tip

Create or edit the sites/default/local.drushrc.php file to get nice URL output from drush uli add this line:

$options['uri']="https://[LANDO-BLT].lndo.site";

Replace LANDO-BLT with the name of your app from the .lando.yml file.

Configure BLT project.yml to Deploy to Acquia Cloud

Open the lightning/blt/project.yml file. Find the git key and add your Acquia git URL as a remote. Should look similar to this:

Deploy to Acquia Cloud

Now deploying to Acquia cloud is as simple as one command: lando blt deploy. This will run the build process, generate your production artifact, and push it to Acquia Cloud! 💯;

It will prompt you for a few options:

lightning (master) $ lando blt deploy
[warning] The xDebug extension is loaded. This will significantly decrease performance.
Typically, you would only create a tag if you currently have a tag checked out on your source repository.
Would you like to create a tag? (y/n) n
Enter a valid commit message [Adding memow module to landolightning.]
Enter the branch name for the deployment artifact [master-build] master

By default the Acquia Cloud dev instance is on the master branch so in the above prompts you specify that (if you want it to deploy out to that environment).

Conclusion

⚡ Selecting the right tools can make your life easier; your app more stable; your clients happier. Everyone is a winner! Combine the best-in-breed tools from local dev with Lando to powerful scalable hosting with Acquia Cloud. ⚡