42
Devops @ Princeton Devops @ Princeton How we track, maintain, and deploy hundreds of sites

Devops @ Princeton - DrupalCampNJ · Drupal 8. Platform Goals Apply lessons learned Provide more flexibility for content modeling More optional modules Reduce number of completely

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Devops @ Princeton - DrupalCampNJ · Drupal 8. Platform Goals Apply lessons learned Provide more flexibility for content modeling More optional modules Reduce number of completely

Devops @ PrincetonDevops @ PrincetonHow we track, maintain, and deploy

hundreds of sites

Page 2: Devops @ Princeton - DrupalCampNJ · Drupal 8. Platform Goals Apply lessons learned Provide more flexibility for content modeling More optional modules Reduce number of completely

WebWebDevelopmentDevelopment

ServicesServices

Page 3: Devops @ Princeton - DrupalCampNJ · Drupal 8. Platform Goals Apply lessons learned Provide more flexibility for content modeling More optional modules Reduce number of completely

Our Website ServicesOur Website ServicesDepartment,

Program,Center

Faculty,Researcher, and

Lab

Student Group,Event, Topical

Page 4: Devops @ Princeton - DrupalCampNJ · Drupal 8. Platform Goals Apply lessons learned Provide more flexibility for content modeling More optional modules Reduce number of completely

Our Website ServicesOur Website Services

Drupal Template

Drupal Custom

Roxen

OpenScholar WordPress

Department,Program,

Center

Faculty,Researcher, and

Lab

Student Group,Event, Topical

Page 5: Devops @ Princeton - DrupalCampNJ · Drupal 8. Platform Goals Apply lessons learned Provide more flexibility for content modeling More optional modules Reduce number of completely

Our Website ServicesOur Website Services

Drupal Template

Drupal Custom

Roxen

OpenScholar WordPress

Department,Program,

Center

Faculty,Researcher, and

Lab

Student Group,Event, Topical

280

40

25

400 450

Page 6: Devops @ Princeton - DrupalCampNJ · Drupal 8. Platform Goals Apply lessons learned Provide more flexibility for content modeling More optional modules Reduce number of completely

Sites DatabaseSites Database

Page 7: Devops @ Princeton - DrupalCampNJ · Drupal 8. Platform Goals Apply lessons learned Provide more flexibility for content modeling More optional modules Reduce number of completely
Page 8: Devops @ Princeton - DrupalCampNJ · Drupal 8. Platform Goals Apply lessons learned Provide more flexibility for content modeling More optional modules Reduce number of completely
Page 9: Devops @ Princeton - DrupalCampNJ · Drupal 8. Platform Goals Apply lessons learned Provide more flexibility for content modeling More optional modules Reduce number of completely
Page 10: Devops @ Princeton - DrupalCampNJ · Drupal 8. Platform Goals Apply lessons learned Provide more flexibility for content modeling More optional modules Reduce number of completely
Page 11: Devops @ Princeton - DrupalCampNJ · Drupal 8. Platform Goals Apply lessons learned Provide more flexibility for content modeling More optional modules Reduce number of completely
Page 12: Devops @ Princeton - DrupalCampNJ · Drupal 8. Platform Goals Apply lessons learned Provide more flexibility for content modeling More optional modules Reduce number of completely
Page 13: Devops @ Princeton - DrupalCampNJ · Drupal 8. Platform Goals Apply lessons learned Provide more flexibility for content modeling More optional modules Reduce number of completely
Page 14: Devops @ Princeton - DrupalCampNJ · Drupal 8. Platform Goals Apply lessons learned Provide more flexibility for content modeling More optional modules Reduce number of completely

TechnologyTechnology

Built with Symfony 3.4Acquia Cloud API"Deployer" for deploying updatesHosted on Princeton VMBackground job runner

Page 15: Devops @ Princeton - DrupalCampNJ · Drupal 8. Platform Goals Apply lessons learned Provide more flexibility for content modeling More optional modules Reduce number of completely

FutureFutureProvisioning/De-provisioning of WP sitesTrack individual OpenScholar sitesAutomated & improved handling of contact infoAbility to duplicate sites

Page 16: Devops @ Princeton - DrupalCampNJ · Drupal 8. Platform Goals Apply lessons learned Provide more flexibility for content modeling More optional modules Reduce number of completely

Drupal 7 TemplateDrupal 7 TemplatePlatformPlatform

Page 17: Devops @ Princeton - DrupalCampNJ · Drupal 8. Platform Goals Apply lessons learned Provide more flexibility for content modeling More optional modules Reduce number of completely

Platform OverviewPlatform Overview

Drupal 7 multisiteAcquia hosted"Locked down"~280 sitesMonthly release cycle

Page 18: Devops @ Princeton - DrupalCampNJ · Drupal 8. Platform Goals Apply lessons learned Provide more flexibility for content modeling More optional modules Reduce number of completely
Page 19: Devops @ Princeton - DrupalCampNJ · Drupal 8. Platform Goals Apply lessons learned Provide more flexibility for content modeling More optional modules Reduce number of completely

Release PlanningRelease Planning& Development& Development

Plan Develop Test Release

Page 20: Devops @ Princeton - DrupalCampNJ · Drupal 8. Platform Goals Apply lessons learned Provide more flexibility for content modeling More optional modules Reduce number of completely

Plan Develop Test Release

Bitbucket issue trackerStandard issue template

Problem/MotivationRelated issue(s)Requester(s)Proposed resolutionAcceptance criteriaDocumentationData model changes

Project MgmtProject MgmtMonthly releasesIssues discussed inlengthPriority given tomigration blockers &major a11y issues3 weeks dev time perrelease

SchedulingScheduling

Page 21: Devops @ Princeton - DrupalCampNJ · Drupal 8. Platform Goals Apply lessons learned Provide more flexibility for content modeling More optional modules Reduce number of completely

Plan Develop Test Release

Local Dev EnvironmentLocal Dev EnvironmentAcquia Dev Desktop - FastDrush make fileGrunt + Drupal Tasks pluginEveryone using a Mac

Page 22: Devops @ Princeton - DrupalCampNJ · Drupal 8. Platform Goals Apply lessons learned Provide more flexibility for content modeling More optional modules Reduce number of completely

Plan Develop Test Release

Code workflowCode workflowNew branch for each feature/bugBranched off "develop"Force specific commit messagePull requests for code review & Proboenvironment

Page 23: Devops @ Princeton - DrupalCampNJ · Drupal 8. Platform Goals Apply lessons learned Provide more flexibility for content modeling More optional modules Reduce number of completely

Plan Develop Test Release

Testing Features & FixesTesting Features & Fixes1. Pull request created2. Reviewers test in Probo3. Pull request merged to "develop"4. Occasionally deploy "develop" to Acquia

"Dev" environment

Page 24: Devops @ Princeton - DrupalCampNJ · Drupal 8. Platform Goals Apply lessons learned Provide more flexibility for content modeling More optional modules Reduce number of completely
Page 25: Devops @ Princeton - DrupalCampNJ · Drupal 8. Platform Goals Apply lessons learned Provide more flexibility for content modeling More optional modules Reduce number of completely

Plan Develop Test Release

Step 1: Deploy to DevStep 1: Deploy to DevBitbucket pipeline manually triggered

1. Checkout "develop" branch2. Run grunt to create build artifact3. Clone Acquia repo and checkout "develop" branch4. Sync build artifact to Acquia repo, commit and push

DevelopmentRepository

"develop" branch

BuildArtifact

AcquiaRepository

"develop" branch

Page 26: Devops @ Princeton - DrupalCampNJ · Drupal 8. Platform Goals Apply lessons learned Provide more flexibility for content modeling More optional modules Reduce number of completely
Page 27: Devops @ Princeton - DrupalCampNJ · Drupal 8. Platform Goals Apply lessons learned Provide more flexibility for content modeling More optional modules Reduce number of completely
Page 28: Devops @ Princeton - DrupalCampNJ · Drupal 8. Platform Goals Apply lessons learned Provide more flexibility for content modeling More optional modules Reduce number of completely

Plan Develop Test Release

Step 2: Deploy to TestStep 2: Deploy to Test1. Another Bitbucket pipeline

1. Clone Acquia repo2. Merge "develop" branch into "stage" branch3. Push to Acquia

2. Acquia cloud hook runs3. Create release notes4. Notify customers5. Visual regression test (sometimes)6. Fix any found issues

Page 29: Devops @ Princeton - DrupalCampNJ · Drupal 8. Platform Goals Apply lessons learned Provide more flexibility for content modeling More optional modules Reduce number of completely

Plan Develop Test Release

BackstopJS

Page 30: Devops @ Princeton - DrupalCampNJ · Drupal 8. Platform Goals Apply lessons learned Provide more flexibility for content modeling More optional modules Reduce number of completely

Plan Develop Test Release

Step 3: Deploy to ProdStep 3: Deploy to Prod1. Another Bitbucket pipeline

1. Clone Acquia repo2. Merge "stage" branch into "master" branch3. Push to Acquia

2. Acquia cloud hook runs3. Notify customers4. Website Wednesday

 

Page 31: Devops @ Princeton - DrupalCampNJ · Drupal 8. Platform Goals Apply lessons learned Provide more flexibility for content modeling More optional modules Reduce number of completely

Drupal 7 Custom PlatformDrupal 7 Custom Platform

Page 32: Devops @ Princeton - DrupalCampNJ · Drupal 8. Platform Goals Apply lessons learned Provide more flexibility for content modeling More optional modules Reduce number of completely

Platform OverviewPlatform OverviewDrupal 7 multisiteAcquia hostedSites can be completely distinct from othersComplicated deployment~40 sitesCan be difficult to maintain

 

Page 33: Devops @ Princeton - DrupalCampNJ · Drupal 8. Platform Goals Apply lessons learned Provide more flexibility for content modeling More optional modules Reduce number of completely

DeploymentDeployment

Site A repo

BuildArtifact

AcquiaRepository

Site B repo

Site C repo

Site D repo

Site E repo

Site F repo

Base distro repoBitbucketPipeline

Page 34: Devops @ Princeton - DrupalCampNJ · Drupal 8. Platform Goals Apply lessons learned Provide more flexibility for content modeling More optional modules Reduce number of completely

Drupal 8Drupal 8

Page 35: Devops @ Princeton - DrupalCampNJ · Drupal 8. Platform Goals Apply lessons learned Provide more flexibility for content modeling More optional modules Reduce number of completely

Platform GoalsPlatform Goals 

Apply lessons learnedProvide more flexibility for content modelingMore optional modulesReduce number of completely custom sitesImprove editorial UXAutomated test suiteAccessible from the startClean, documented code (reduce tech debt)

Page 36: Devops @ Princeton - DrupalCampNJ · Drupal 8. Platform Goals Apply lessons learned Provide more flexibility for content modeling More optional modules Reduce number of completely

Local DevelopmentLocal DevelopmentDocker-basedNot using a dockerwrapper (dosksal, lando)NFS for faster fileperformanceCommon env for everyoneStill not ideal

Page 37: Devops @ Princeton - DrupalCampNJ · Drupal 8. Platform Goals Apply lessons learned Provide more flexibility for content modeling More optional modules Reduce number of completely

Automated TestingAutomated TestingPros:

Big wins for catchingregressionsPeace of mind

ConsSlows developmentRefactoring testsrequiredSlow to run

Page 38: Devops @ Princeton - DrupalCampNJ · Drupal 8. Platform Goals Apply lessons learned Provide more flexibility for content modeling More optional modules Reduce number of completely

Scenario: Admins can define and use CKEditor styles Given I am logged in as an "admin" And I am on "/admin/config/content/ckeditor-standalone-styles" And I fill in "Styles" with "This is bad" And I press "Save configuration" Then I should see the error message "The provided list of styles is syntactically When I fill in "Styles" with: """ h2.heading-test-class-a.heading-test-class-b|Heading Test Style p.first-paragraph-test|First Paragraph Test Style p.second-paragraph-test|Second Paragraph Test Style """ And I press "Save configuration" Then I should see the success message "The configuration options have been saved." # Now to go a page and verify the styles dropdown is there and can be used. When I am on "/node/add/ps_basic_page" Then CKEditor "edit-field-ps-body-0-value" exists And CKEditor "edit-field-ps-body-0-value" should contain styles: | element | name | classes | h2 | Heading Test Style | heading-test-class-a heading-test-clas | p | First Paragraph Test Style | first-paragraph-test | p | Second Paragraph Test Style | second-paragraph-test # Now manually insert some HTML that uses those styles and confirm Drupal doesn't # strip them out. I found no easy way to actually interact with the buttons in # the editor, so we just fill in manually. And I fill in "Title" with "Sample Page" And I put '<h2 class="heading-test-class-a heading-test-class-b">Test heading</h2> And I press "Save" Then I should see the success message "Page Sample Page has been created" And the response should contain "<h2 class=\"heading-test-class-a heading-test-cla And the response should contain "<p class=\"first-paragraph-test\">First test para And the response should contain "<p class=\"second-paragraph-test\">Second test pa

And the response should contain "<p>Invalid paragraph</p>"

Page 39: Devops @ Princeton - DrupalCampNJ · Drupal 8. Platform Goals Apply lessons learned Provide more flexibility for content modeling More optional modules Reduce number of completely

Dev & Deploy WorkflowDev & Deploy WorkflowJira - more robust project planningStill refining release cycleBitbucket Pipelines

Automated testsRelease to Dev/Stage/ProdSub-tree split install profile

Acquia BLTCreating build artifactsRebuilding local envSyncing remote data to local

Page 40: Devops @ Princeton - DrupalCampNJ · Drupal 8. Platform Goals Apply lessons learned Provide more flexibility for content modeling More optional modules Reduce number of completely
Page 41: Devops @ Princeton - DrupalCampNJ · Drupal 8. Platform Goals Apply lessons learned Provide more flexibility for content modeling More optional modules Reduce number of completely
Page 42: Devops @ Princeton - DrupalCampNJ · Drupal 8. Platform Goals Apply lessons learned Provide more flexibility for content modeling More optional modules Reduce number of completely

Questions?Questions?