Digital Team
About UsEdit in Gitbook
  • Welcome
  • Getting started
    • Life on the Digital team
      • Meetings
      • Communication
      • Software engineering working agreement
    • Contributing to Boston.gov
    • Using GitBook
  • Standards & best practices
    • Digital Team Release Notes
    • Working with Partners
    • Accessibility at COB
      • Developers
      • Content Editors
        • How to guide
      • Resources
      • Working with Iterators
    • Analytics and Metrics
    • Code of Conduct
    • General
    • Code reviews
    • Project Management
    • Git / GitHub
      • Contacts at Github
      • Git Command Tips
      • GitHub Service Accounts
    • Code quality
      • Automated tests & static analysis
      • Code comments
      • Style guides
        • Drupal/PHP
          • D8 Dependency Injection (DI)
        • React/TypeScript
    • Technical documentation
    • Hosting and monitoring
    • Deployment
  • Guides
    • Technology stack and technologies used
      • Web applications
    • Drupal - boston.gov
      • Custom Development & Configuration
        • On Demand Instances
          • Acquia Environment setup checklist
        • Continuous Deployment Process
        • Developer Onboarding
          • Step 1: Local Dev Environments
          • Step 2: Version control
          • Step 3: Introduction to Drupal
          • (to be sorted)
            • Development environment
              • PHP CodeSniffer
              • VSCode IDE Setup
              • AWS for Developers
              • Using Windows
            • Installation instructions
              • Typical build output
              • Lando 101
              • Verify Installation
                • Local Patterns installation
              • Windows install
              • PhpStorm settings configurations
          • Step 4: Site Building in Drupal 8
        • Site Development Notes
          • Git Best Practices - Drupal
          • Drupal Cache
          • Drupal Config
          • Custom Modules
            • Custom Themes
              • Front-end Theme (bos_theme)
                • Site Breadcrumbs
              • Back-end Theme (bos_admin)
            • Adding Templates to Custom Modules
            • Custom Content Types
              • D7 -> D8 Conversion
              • Content Editor UX
                • Content Moderation
              • In-page Navigation Menu
            • Custom Paragraphs
              • D7 -> D8 Conversion
            • Custom Taxonomies
            • WebApps
          • Drupal UX-specific
            • Image Styles & UX
            • Example Content Pages
          • PHPStorm IDE
        • CKEditor
      • Drupal Apps/Content Types
        • Budget Website
        • Building Housing
          • BH Drupal Entities
          • BH Map Webpage
          • BH Property Webpage
            • BH Project Timeline
          • BH Salesforce Sync
            • Salesforce Contributed Module
        • Contact Form
        • Election results
        • Google reCAPTCHA
        • My Neighborhood Lookup
        • Metrolist
        • Metrolist (Drupal)
        • Project Tracker
          • Content Types (& Paragraphs)
          • Taxonomies
          • Views
          • Developer Notes
      • Drupal Features & Components
        • Single Sign On (SSO)
          • Drupal SAML Knowledgebase
          • SamlAuth
        • Maps on boston.gov
        • Charts on boston.gov
          • Quick Overview
          • Chart Data
          • Chart Configuration
          • Advanced Concepts and Techniques
          • Charts on boston.gov (legacy)
          • Useful Resources
      • Drupal micro-services (API end-points)
        • Integrating with Boston.gov
        • Assessing Forms Endpoint
        • Bos311 API
        • Cityscore
          • Knowledge Base
        • PDF Manager Module
        • PostMark Email Services
          • Postmark Knowledgebase
        • Upaknee Email List Services
        • Public Notices
        • Site Alerts
          • CodeRed Subscription
      • Drupal - Weekly Maintenance
      • Drupal - Periodic Maintenance
    • Digital Webapps
      • Libraries and Tools
        • Emotion
        • Storybook
        • Rollbar
      • Services
        • AWS-hosted Microservices
          • SQL Proxy API (DBConnector)
            • Developer Notes
          • PDFToolkit API (DB Connector)
            • Developer Notes
      • Webapps - Maintenance
      • Webapps
        • Boston Family Days
        • Property Tax Calculator
        • Access-Boston
          • Updating IAMDIR/Group Management/LDAP certificates
          • Node Server
          • Portal App Tile Configurations
          • Ownership of Concerns
          • Updating SAML Certificates
          • Applications/Services
            • Group Management
            • Confirm ID/ID Verification
            • Preferred Name
        • Sanitation Scheduling
        • Registry-Certs
          • Marriage Intention
      • DevOps
        • New service setup
          • Non-Monorepo Service Setup
        • Service Configuration
          • Editing a project’s configuration using Cyberduck
        • Managing AWS
          • Production Overview
          • AWS Bastion Access
          • Terraform
            • Updating the ECS cluster AMI
          • Restarting an ECS service
          • Encrypting service configuration for S3
          • Mounting AWS SFTP as a Drive (Mac)
        • Webapp Deployment
          • Deploy to AWS 2021
            • Deploy Tool (cob_ecrDeploy)
    • Fleet - Pattern Library
      • Patterns Library Architecture
      • Icon Library Architecture
      • Developers
        • Local Development for Drupal Developers
      • Patterns Library Maintenance
    • Legacy Website - cityofboston.gov
      • Animal Control
        • Dog Licenses
      • No Tow
        • Street Sweeping Reminders
        • Street Occupancy Alerts
        • Towing Alerts
        • Towing Search
        • Subscription Search
        • Proposed Restructure
          • Backend
        • Reillys Notes
      • Workers' Compensation Inquiry Form
      • Streetbook
      • Legacy Website - Maintenance
        • Animal Control Maintenance
        • Assessing Online (AOL) Maintenance
          • Knowledge-base
          • Disclosure Period
          • Annual PDF Initialization
          • Database Tables
        • No-Tow Maintenance
    • AgilePoint
      • AgilePoint: Adding Users
      • Migrating AGP Applications from one platform to another
    • The Hub - hub.boston.gov
      • The Hub - Maintenance
    • Maintenance
      • Updating SSL Certificates
    • Redirects
      • Redirecting from cityofboston.gov
      • URL redirects versus URL aliases - Drupal
      • DNS Redirects
    • Decommissioned Apps or Services
      • Archived Forms Information
      • CodeRed
      • Drupal 7
        • Deployment (2019)
          • Why do we peer-review pull-requests ?
      • Rentsmart
      • SnowStats
      • Ruby
    • Weglot translation
      • What to do in Weglot
      • What to do on the website or page
        • Softr
        • Drupal Powered Pages
        • Custom Pages
  • Projects
    • Project: Patterns Library Cleanup
      • Project: Refactoring Legacy CSS
        • Strategy
        • Regression Testing
        • Maintenance
    • Project: Upaknee
    • Project: Everbridge API + UI
    • Project: 311 CRM Upgrade
      • Project: City Worker Upgrade to City Worker 5
      • Project: Lagan 311 CRM upgrade to 15r4
    • Project: Fleet (Pattern Library Design System)
    • Project: Monorepo Decoupling
    • Inactive projects
      • Project: 311 (Salesforce Upgrade)
      • Project: Access Boston
        • General/Historical Documentation
          • Edit Config and Upload Icons
        • Processes
          • Process: Adding New Icon to Access Boston Website
          • Process: Non-icon Access Boston Feature or Bug Requests
          • Self-Service
      • Project: Alexa Skill
      • Project: Assessing Online
        • 2022 Notes
      • Project: Boards and commissions
      • Project: City Hall Appointment Scheduler
      • Project: CityScore
      • Project: Mobile Apps
      • Project: Permit Finder
      • Project: Public Notice Signage
      • Project: Registry Suite
        • Birth certificates
        • Marriage Certificates
        • Marriage Intention
        • Death Certificates
      • Project: Work With U.S. Digital Response Team
      • Project: TDM Points App
      • Project: Translation on boston.gov
  • External resources
    • Learning resources
    • Reference links
    • Applications and extensions
Powered by GitBook
On this page
  • Deployment step-by-step Workflow.
  • Deployment Engineering.
  • www.boston.gov and hub.boston.gov

Was this helpful?

Export as PDF
  1. Guides
  2. Decommissioned Apps or Services
  3. Drupal 7

Deployment (2019)

Deployment practice and workflows from March 2019.

PreviousDrupal 7NextWhy do we peer-review pull-requests ?

Last updated 6 years ago

Was this helpful?

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.

Important - don't forget ....

  • Developer updates features (using Drupal features module) as needed.

  • Developer commits code and features changes to my-branch branch of local repository.

  • Develop runs local PHPUnit, behat and linting tests.

  • Developer pushes local branch my-branch to a branch of the same name (i.e. my-branch) on the .

  • Developer creates a new Pull Request (PR) to merge my-branch into developon the GitHub repository.

    • Developer provides appropriate notes (in template form) in the PR comments.

    • Developer assigns a peer-developer to .

Once a new PR to develop is created in GitHub, Travis starts a build verification process, which attempts to build a new Drupal site from the files my-branch, and then run various linting, PHPUnit and Behat tests.

  • Developer mergesmy-branchinto develop when the peer-review is complete and the Travis build tests pass.

  • Developer deletes my-branch locally and on GitHub when the merge to develop is complete.

It is acceptable to use the GitHub "Squash and Merge" function when merging a branch into develop.

Travis monitors the GitHubdevelop branch, and when a commit is performed (either a direct commit or a merge process) to the branch Travis starts a deploy process:

The devAcquia server/environment monitors the Acquia develop-buildbranch and when that branch is updated (i.e. a merge/commit is made) it automatically pulls the updated code onto the appropriate server, and

  • backs up the database on the Acquia dev environment

  • copies the database from the Acquia stage environment to the Acquia devenvironment.

  • runs processes on the dev environment to sync the (updated) code and the (copied) database.

  • A Senior Developer from the team creates a PR to merge developinto master when a deploy is desired. Ideally this is done frequently with just a single branch pre-deploy.

    • The City of Boston Website Product Manager, and

    • QA representative.

  • The Senior Developer merges the PR into master.

Do not use GitHub's "Squash and Merge" feature when merging the PR as this breaks consistency between master and develop on GitHub.

Travis monitors the GitHub stage branch, and when a commit is performed (either a direct commit or a merge process) to the branch Travis starts a deploy process:

The stageAcquia server/environment monitors the Acquia master-buildbranch and when that branch is updated (i.e. a merge/commit is made) it automatically pulls the updated code onto the appropriate server, and

  • backs up the database on the Acquia stage environment, and

  • copies the database from the Acquia prod environment to the Acquia stageenvironment, and

  • runs processes on the stage environment to sync the (updated) code and the (copied) database.

After testing is competed:

  • The City of Boston Website Product Manager (or someone delegated) completes change and release documentation, and

  • Ensures the developer(s) who made the changes in the release is available in case of issues in production, and then

  • Using the Acquia Cloud web-UI: the Product Manager (or someone delegated) drags the code from the stage environment to the prod environment.

Acquia-hooks will detect that the code has been moved and will:

  • backup the Production database,

  • run drush commands to update configurations from the new code into the Production database.

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

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.

Reviewers are assigned ():

CoB GitHub repository
boston.gov-d7
review the code
see reviewer notes here