Deployment (2019)

Deployment practice and workflows from March 2019.

Deployment step-by-step Workflow.

The following is a table showing the various stages of a deploy to production.

  • Developer checks out the develop branch of the main repository.

  • Developer builds local docker container, and builds Drupal site in container.

  • Developer creates new working branch e.g. my-branch.

  • Developer makes necessary changes to website and/or to PHP code.

  • Developer tests changes locally.

There are scripts which can be used to make the container and build Drupal.

==========================================================================

Deployment Engineering.

The automated deploy process follows continuous deploy (CD) principles whereby:

  • The deploy workflow is engineered so that all developers are able and enabled to perform a deployment,

  • Wherever possible, the workflow is automated to remove the need for manual tasks and testing.

The primary tools used by City of Boston in the CD workflow process are:

  • Docker to manage local development environments.

  • GitHub for code storage and deploy initiation.

  • Travis for automated testing, building and packaging.

  • Acquia Cloud (acapi and cloud webhooks) for deployment.

Secondary tools used by City of Boston in the CD process are:

  • Phing to abstract scripting processes used in build, test and packaging.

  • PHPUnit and behat to perform automated testing.

Overall the engineering workflow is as follows:

Deploy Worflow Start
 ├── Github used to deploy to Acquia dev environment
    └── developers test
 ├── Github used to deploy to Acquia stage environment
    └── QA test
 ├── Acquia web UI used to deploy to Acquia prod environment
 └── deploy complete
Deploy to Acquia Environment
├── Git commit to GitHub branch
  ├── Travis application triggered from GitHub
    ├── Drupal build new artifact in remote Travis container
    ├── automated testing in remote Travis container
    ├── build artifact commited to Git in Travis
    └── Travis Git branch commited to Acquia Git
  ├── Acquia cloud triggered from Acquia Git
    ├── Acquia Cloud hooks triggered
      ├── Code copied into Acquia environment
      ├── Drupal DB backup 
      ├── new DB copy pulled from next environment in workflow 
      └── DB and code synchronized

www.boston.gov and hub.boston.gov

City of Boston operate 2 websites (hub and boston), each being an "application" on Acquia. The Drupal code-base on the 2 websites is very similar, the main differences being some settings files and the content contained in the applications database.

The overall engineering utilizes a single repo in GitHub, and a single repo in Acquia's Git.

The workflow engineering creates and manages a single develop and single master branch in GitHub -these ultimately are common to hub and boston websites. However, the Acquia environments (dev, stage, prod) in each application (boston, hub) are attached to different branches of the Acquia git. Hub branches are suffixed with -hub. These branches are created by and during the Travis packaging process.

Last updated