City of Boston strives to automate the develop, test, package and deploy process at each step from local development to deployment in live production,
This page is out of date and needs review (as at 17 June 2021)
The repository is cloned in a local folder and ready for building.
This entry condition can be achieved:
If you have not yet built the boston.gov website on your local machine, or
If you have cloned a new branch or created a new branch that you wish to build, you can run the doit rebuild quick
script, or
If you have the repository cloned, but wish to delete it and rebuild a fresh website from a branch on the GitHub repository, you can run doit rebuild full <branch>.
If you don't specify a branch, then develop
will be used.
Local developer responsible for creating local development environment.
The local build process is defined and controlled by Lando when lando start
is executed.
The doit
scripts serve to prepare the cloned repository prior to running lando start
Lando
lando start
causes the following processes to be run from lando.yml
3 standard Linux (ubuntu) containers are created. One optimized as an appserver with Apache, one optimized as a database server with MySQL and one with Node.
Install the required/dependent packages and tools -including Phing and Composer.
Create and install XDebug and other Apache/PHP settings files.
Set apache vhosts and container's network configs. (done by Docker via Lando).
Start all 3 containers.
Launch the phing script setup:docker:drupal-local
.
Phing
The phing scriptsetup:docker:drupal-local
in reporoot/scripts/phing/tasks/setup.xml
executes the following:
Download Drupal dependencies into Apache appserver container - including Drush. (done using Composer).
Download confidential settings and copy into Drupal file system (using Git).
Install Drupal by Installing a new Database on the database container. (using Drush).
Install Drupal modules and load configuration files. (using Drush).
Run Drupal's Update process to load updated-settings from modules. (using Drush).
Modify Drupal settings with localized settings.
Reset the admin password and issue login url. (using Drush).
Run Linting Test using PHP Linting. (done by PHP via Phing, launched by Travis).
Run Code Sniffer Test. (done by Sqizzlabs via Phing, launched by Travis).
(coming soon) Run Behat behavioral tests. (done by Behat via Phing, launched by Travis).
(coming soon) Run PHPUnit functional tests. (done by PHPUnit via Phing, launched by Travis).
For local development, the docker container build is controlled by Lando, with Phing being used to build Drupal.
When a Pull Request is created to merge code into the develop branch on Github a test build and some automated testing is run by Travis. Travis is used in place of Lando to initiate and control the build process as described above (i.e. Travis is used to build docker containers on Github/Travis infrastructure, whereas Lando builds docker containers on local machines). In both cases the Travis and Lando scripts are very similar in structure and identical (as possible) in function. Once the containers a built, both tools use the same Phing scripts to build and initiate Drupal.
(coming soon) Terraform will be used to spin up on-demand test/develop/experiment/demo instances of the containers (i.e. the websites) on AWS infrastructure. In this case Terraform scripts will be used to control the build in place of Lando - but (as with Travis) will be as similar as possible in function. Again, once the containers a built on AWS, the same Phing scripts will be used to build Drupal.
Run Linting Test using PHP Linting. (done by PHP via Phing, launched by Travis).
Run Code Sniffer Test. (done by Sqizzlabs via Phing, launched by Travis).
(coming soon) Run Behat behavioral tests. (done by Behat via Phing, launched by Travis).
(coming soon) Run PHPUnit functional tests. (done by PHPUnit via Phing, launched by Travis).
For local development, the docker container build is controlled by Lando, with Phing being used to build Drupal.
When a Pull Request is created to merge code into the develop branch on Github a test build and some automated testing is run by Travis. Travis is used in place of Lando to initiate and control the build process as described above (i.e. Travis is used to build docker containers on Github/Travis infrastructure, whereas Lando builds docker containers on local machines). In both cases the Travis and Lando scripts are very similar in structure and identical (as possible) in function. Once the containers a built, both tools use the same Phing scripts to build and initiate Drupal.
(coming soon) Terraform will be used to spin up on-demand test/develop/experiment/demo instances of the containers (i.e. the websites) on AWS infrastructure. In this case Terraform scripts will be used to control the build in place of Lando - but (as with Travis) will be as similar as possible in function. Again, once the containers a built on AWS, the same Phing scripts will be used to build Drupal.