Lando 101
Using Lando in City of Boston.
What is Lando ?
For our purposes, Lando is a PHP-based tool-set which does 3 main things:
Provides a pre-packaged local docker-based development environment,
Provides a wrapper for common docker container management processes,
Provides a means to execute development commands inside the container from the host.
Lando 101.
1. A Pre-packaged Drupal infrastructure on your local computer.
Lando curates an appropriate LAMP stack for Drupal development, largely removing the need for this skill in the local development team. The stack is contained within:
Docker images that are maintained by Lando.
A configuration file (landofile) which Lando parses into the necessary dockerfiles and utility scripts
COB uses a landofile which can be found at /[reporoot]/.lando.yml
2. Container Management
Lando provides a CLI for tasks developers commonly need to perform on the container.
A full list of defined Lando commands can be obtained by executing:
lando
Command | Explanation |
Starts all 3 lando containers, building them if they don't already exist. | |
Stops all 3 containers, but does not delete or destroy them. They can simply be restarted later. | |
Will rebuild the container using the values in the
| |
Will destroy the container.
|
3. Command Line Interface for tasks in the
Lando provides a CLI for tasks developers commonly need to perform in the container.
Command | Explanation |
Opens a bash terminal on the appserver docker container. If the -c switch is used,
then a terminal will be opened, the command provided will be run in the container and then the session will be closed.
| |
| Executes a drush cli command in the appserver container:
|
| Executes a Drupal cli command in the appserver container:
|
| Executes a Composer command on the appserver container:
|
| Executes a cob script which copies the database from the stage environment to the local development environment, and sync's all the configurations etc.
|
| Executes a cob script which pulls the latest project repository from gitHub and then clones and merges the private -repository. Finally it runs sync tasks to update the DB with any new configurations.
To update the repo's without sync'ing the content, execute:
|
| Locally runs the linting and PHPCode sniffing checks that are run by Travis. |
| Allows you to switch between patterns CDN hosts. |
A full list of defined Lando commands can be obtained by executing:
lando
Lando Workflows.
- Pull and sync latest version of the github for the checked-out branch.
lando drupal-pull-repo
- Update local DB with content from Acquia Stage site
lando drupal-sync-db
- Update both code and DB locally, but leave container intact
lando drupal-pull-repo --no-sync &&
lando drupal-sync-db
- Completely rebuild local development environment
lando rebuild
or to be completely sure, run these commands from the
lando destroy &&
rm -rf <repo-path>
git clone -b develop git@github.com:CityOfBoston/boston.gov-d8.git <repo-path>
lando start
Last updated