Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
The following is a printout of the console from a typical build following the instructions on Installation Instructions page.
Specifically this output is from the command:
The log above was generated using lando start
with this.lando.yml
landofile.
The log above was generated using lando start
with thisconfig.yml
project file.
Creates a drupal 8 container, mysql container and node container, and connects them all up.
For more detailed install and usage instructions for various platforms, see "More Help" below.
Ensure you have set up your development environment as described here:
On host computer, change directory to the repository root and use lando to create and start containers:
lando start
Depending on the power of the host machine, the Drupal 8 build process for boston.gov can take more than 15-20 minutes. The composer install and site install (esp. config import) tasks can take 5-10 minutes each - with no updates being directed to the console.
-> You can follow the process by inspecting the log files in docroot/setup/
there are links to these files in the console.
From the repository root (on host):
to view a list of available lando commands:lando
to view phing tasks: lando phing -l
to run drush commands:lando drush <command>
lando ssh
to login to docker container as www-data
lando ssh -user=root
to ssh and login as root
lando ssh <servicename>
servicename = appserver / database / node
To reduce typing at the console, you can add the following aliases to your ~/bashrc
, ~/.bash_aliases
or ~/.bash_profile
files on your development (host) OS.
With these aliases, typing (in a console) lls <folder>
will use lando to run ls -la <folder>
in the default container (in our case appserver) and list files there. Whereas, ls <folder>
will list the folder locally (i.e. on the host) as usual.
For more information on installation, usage and administration of the development area, go to the next section.
Using Lando in City of Boston.
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 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
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
Lando provides a CLI for tasks developers commonly need to perform in the container.
A full list of defined Lando commands can be obtained by executing:
lando
lando drupal-pull-repo
lando drupal-sync-db
lando drupal-pull-repo --no-sync &&
lando drupal-sync-db
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
Clone the public into a local folder
git clone -b <branchname> git@github.com:CityOfBoston/boston.gov-d8.git
(City of Boston DoIT recommends that the develop branch be used)
In the context of this document: Think of as a for a stack constructed in .
For some people working within lando containers slows down and crashes their environment. To fix this they can work outside lando containers (patterns.lndo.site) and directly with localhost:3030
The local development version of the CDN is hosted by Fleet at http://localhost:3030. This local CDN is served (by Node/Fractal) from your local environment.
Super-powers are granted randomly so please submit an issue if you're not happy with yours.
Once you're strong enough, save the world:
For developers using PhpStorm IDE how and where to update your settings/preferences to make debugging and developing in Drupal easier.
That's a tough question but thankfully, our team is on it. Please bear with us while we're investigating.
Yes, after a few months we finally found the answer. Sadly, Mike is on vacations right now so I'm afraid we are not able to provide the answer at this point.
If the installation has completed without errors, then you should be able to check the following:
The repo that was checked out in Step 1 of the installation instructions is hosted on your dev computer, and is mounted into each of the docker containers. As you make changes to the files on your dev computer, they are instantly updated in all of your local docker containers.
The production/public website is hosted by Acquia and can be accessed at https://www.boston.gov.
The local development version of the public website can be viewed at: https://boston.lndo.site. This local copy of the Drupal website is served (by Apache) from the appserver
docker container, and its content is stored and retrieved from a MySQL database in the database
docker container.
You will find the CityOfBoston/patterns repo cloned into the root/patterns
folder on your host dev computer.
The production/public patterns library is hosted by City of Boston from our AWS/S3 infrastructure and can be accessed at https://patterns.boston.gov.
The local development version of the patterns library is hosted by Fleet and can be viewed at https://patterns.lndo.site. This local copy of the Fleet website is served (by Node/Fractal) from the patterns
docker container.
You will find the CityOfBoston/patterns repo cloned into the root/patterns
folder on your host dev computer.
The gulp, stencil, fractal and other services running in thepatterns
docker container will automatically build the local fleet static website into root/patterns/public
from the underlying files in real-time as they are changed.
The production/public patterns CDN is hosted by City of Boston from our AWS/S3 infrastructure at https://patterns.boston.gov.
The local development version of the CDN is hosted by Fleet at https://patterns.lndo.site. This local CDN is served (by Node/Fractal) from the patterns
docker container.
You will find the CityOfBoston/patterns repo cloned into the root/patterns
folder on your host dev computer.
The gulp, stencil, fractal and other services running in thepatterns
docker container will automatically build the local fleet static website into root/patterns/public
from the underlying files in real-time as they are changed.
Steps 1 - 7 must be completed while the computer is connected to the city network.
Using Windows POWERSHELL (as Administrator):
Launch POWERSHELL as administrator: search powershell
from Windows search
Alternative strategy
This may work without Windows requesting a restart at the end.
Using CMD (console):
To open a CMD console search for cmd
in the Windows search
Alternative strategy:
This may provide a more fault tolerant WSL environment when we are switching from City network to external network (because we are controlling where the distro is installed, and its not on the user's profile).
Using LINUX (WSL) console:
To get the Linux console, open a CMD console, type: wsl
@see https://docs.microsoft.com/en-us/windows/wsl/wsl-config
These configuration files tweak the WSL environments to enable a better developer experience based on a standard CoB laptop configuration (i.e. minimum i7 chip, 32GB RAM and SSD harddisk).
Using a POWERSHELL console from the windows host:
Using a LINUX console (WSL):
Using LINUX console
If you have accessing the internet from WSL first try RESTARTING the computer.
If that does not work, using a LINUX console try:
=> then restart the computer.
Mount your development folders into WSL using the LINUX console:
Replace c:/Users/xxxx/sources
with the location in the windows host where you plan to keep all development source files.
This is the folder where you will be cloning the CoB repos.
If in doubt, create a sources
folder in your windows home folder, and for the command above just replace xxxx
with your CoB supplied EmployeeID/User Account.
Replace yyyy
with the accountname you used when you installed WSL (you can find this in the LINUX console by running cd ~ && pwd
- the path displayed be in the format /home/accountname
Download installer from https://docs.docker.com/desktop/windows/install/
Double click the installer to launch: + Click OK to accept non-windows app, + Select WSL2 as the backend (rather than Hyper-V)
Docker desktop does not automatically start after the install, you need to start it the first time from the Start menu.
Restart your computer after this step.
If you do not, and subsequently restart the computer while off the city network, your installation will be broken, and you will have to remove Docker and WSL, and start over.
(see "Docker Fails to Restart" notes below to fix broken/non-functional WSL installs)
Verify AWS is installed using LINUX console:
You should see an output something like:
aws-cli/2.7.4 Python/3.9.11 Linux/5.10.102.1
.....
Obtain your secret access keys for AWS from the AWS administrator, and then create the AWS credentials file using the LINUX console:
Alternatively. you could also create and edit the credentials file using vim
which is installed in the WSL instance (from step 5 above).
Add your ssh keys to into your windows account (typically into a windows folder on you home drive) and then from a LINUX console:
Replace xxxx with your EmployeeID/User Account from CoB.
Microsoft Visual Studio Code (VSC)
PHP Storm
Using POWERSHELL:
Using POWERSHELL:
Using LINUX console:
Replace xxxx
with your CoB supplied EmployeeID/User Account.
Replace yyyy
with the accountname you used when you installed WSL.
Using LINUX console:
Replace yyyy
with the accountname you used when you installed WSL.
Using LINUX console:
Using Powershell (as Administrator):
From Powershell console reinitialize WSL:
From LINUX (WSL) console reset the nameserver so you can access the internet:
Where X.X.X.X is the IPAddress: 8.8.8.8 (confirm if there should be a different address) when in the office and 10.241.241.70 when not on the city network but using a VPN.
If, when restarting the computer, Docker fails to start and/or you get the following error when starting WSL:
The service cannot be started, either because it is disabled or because it has no enabled devices associated with it.
To fix this, perform the following steps.
Step 1: Using Powershell (ps) as Admin:
Step 2: Then using a CMD shell (as Admin)
Step 3: Restart Docker for Windows from the start menu.
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.
|
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. |