41
Lessons Learned Predictable Continuous Deployment DrualCorn August 2016

Drupal Continuous Integration and devops - Beyond Jenkins

Embed Size (px)

Citation preview

Page 1: Drupal Continuous Integration and devops - Beyond Jenkins

Lessons Learned

Predictable ContinuousDeployment

DrualCorn August 2016

Page 2: Drupal Continuous Integration and devops - Beyond Jenkins

1

2

3

1

Agenda

Lessons in doing things the wrong way

Components of Good Predictable Continuous Deployment

How do we do it with Drupal

Page 3: Drupal Continuous Integration and devops - Beyond Jenkins

2

What this Presentation is not about

• Tools• Code Examples• Specific Prescribed Framework (BLT, etc.)

Page 4: Drupal Continuous Integration and devops - Beyond Jenkins

3

About Us

Page 5: Drupal Continuous Integration and devops - Beyond Jenkins

Who are we?

4

Page 6: Drupal Continuous Integration and devops - Beyond Jenkins

WE PROVIDE SOLUTIONS WITH MEASURABLE RESULTS

BRAND CHARACTER

5

Promet Source revolves around customer satisfaction and providing dynamic solutions returning, real measurable results. We don't just work for our clients, we work with our clients as a seamless extension of their team. Our core focus is to inspire with our strategy and deliver groundbreaking results with our approach.

Page 7: Drupal Continuous Integration and devops - Beyond Jenkins

SERVICES SOLUTIONS

THE ROADMAP TO RESULTS

6

1. DISCOVERYYou must identify your resources before you can leverage them. Promet’s Discovery phase takes a look at your brand’s technical and creative assets through the lens of user-centric design.

2. DESIGNThere are many paths to connect with your users: on desktop, mobile and any place in between. The right path should meet users without resistance and be responsive to their needs. This is the core of user-centric design,and Promet’s approach to Design identifies the right path before embarking on the journey.

3. DEVELOPMENTBuild something memorable. Promet is the champion of complex web development projects that require custom code, custom module development, custom APIs, migrations, sophisticated integrations and more. Working with Promet’s Development team allows your brand to build digital properties that won’tfade into the background.

4. SUPPORTYour website or app is a living, evolving entity. Keep its growth and security on track by working with Promet’s dedicated Support team.

FOR TARGET INDUSTRYPromet understands that Drupal is the ideal solution for clients that need donation and membership management tools built into their website. Promet has built countless solutions for Governmental, Higher Education, Association and Nonprofit clients using this knowledge.

FOR TARGET RESULTGrow your donor base or enhance your lead generation pipeline. Promet’ssolutions are fed by our deep understanding of eCommerce implementations and automated marketing systems integration within Drupal.

Page 8: Drupal Continuous Integration and devops - Beyond Jenkins

7

Who Are You?

Page 9: Drupal Continuous Integration and devops - Beyond Jenkins

Why should you care about CI/CD

8

Page 10: Drupal Continuous Integration and devops - Beyond Jenkins

9

Page 11: Drupal Continuous Integration and devops - Beyond Jenkins

Goal

There should be two tasks for a human being to perform to deploy software into a development, test, or production environment: to pick the version and environment and to press the “deploy” button.

Humble, Jez; Farley, David (2010-07-27). Continuous Delivery: Reliable Software Releases through Build, Test, and Deployment Automation (Adobe Reader) (Addison-Wesley Signature Series (Fowler)) (pp. 5-6). Pearson Education. Kindle Edition.

10

Page 12: Drupal Continuous Integration and devops - Beyond Jenkins

Common Antipatterns

• Deploying Software Manually• Deploying to a Production-like environment Only after

Development is Complete• Manual Configuration Management of Production

Environments

11

Page 13: Drupal Continuous Integration and devops - Beyond Jenkins

12

Page 14: Drupal Continuous Integration and devops - Beyond Jenkins

Principles of Software Delivery

• Create a Repeatable, Reliable Process for Releasing Software

• Automate Almost Everything• Keep Everything in Version Control• If it Hurts, Do it more frequently and bring the pain

forward• Build Quality In• Everyone is Responsible for the Delivery Process• Continuous Improvement

13

Page 15: Drupal Continuous Integration and devops - Beyond Jenkins

Organizational Benefits

14

Page 16: Drupal Continuous Integration and devops - Beyond Jenkins

State of DevOps report 2016

15

Page 17: Drupal Continuous Integration and devops - Beyond Jenkins

State of DevOps report 2016

16

Page 18: Drupal Continuous Integration and devops - Beyond Jenkins

State of DevOps report 2016

17

Page 19: Drupal Continuous Integration and devops - Beyond Jenkins

18

Page 20: Drupal Continuous Integration and devops - Beyond Jenkins

19

The Predictable Continuous Deployment

Page 21: Drupal Continuous Integration and devops - Beyond Jenkins

Predictable CI at Promet

20

Page 22: Drupal Continuous Integration and devops - Beyond Jenkins

Local Development Development Staging Production

Code Base Code Base Code Base Code Base

Code Moves Upstream (version control tools)

Content/Data Moves Downstream (migration tools)

Files Move Downstream (file copy / sync tools)

Our Processes for Drupal Development and Operations = Faster and More Reliable Deployments

Code-driven development > Complete site managed and built from code

Automated application infrastructure in code > Same configuration used across all environments

Automated site builds, testing and monitoring > Better feedback provided early and often

Vagrant Features Git

Ansible Drush Gitflow

AWS Acquia Private Cloud

Rackspace Pantheon Internal Servers

We develop locally with: We deploy to hosting with:

Deploy Deploy Deploy

We Follow Best Practices for Development and Operations

Database Files Database Files Database Files Database Files

21

Page 23: Drupal Continuous Integration and devops - Beyond Jenkins

A Brief History

22

Page 24: Drupal Continuous Integration and devops - Beyond Jenkins

A Brief History?

23

GITFeaturesBash VagrantEnvironmentsAnsibleGitflowJenkinsComposerCodesnifferBehat

GITFeaturesBash VagrantEnvironmentsAnsibleGitflowJenkins

GITFeaturesBash EnvironmentsChefVagrantGitflow

GITFeaturesChefUpdate scriptsBashGitflow

GITFeaturesChef

Page 25: Drupal Continuous Integration and devops - Beyond Jenkins

CI Principles

Continuous Integration 10 Principles1. Revision Control2. Build Automation3. Automate Deployment4. Self-Testing Build5. Testing in a Clone of Production6. Frequent Commits7. Code Consolidation8. Fast Builds9. Build Availability

10. Test Result Availability

24

Page 26: Drupal Continuous Integration and devops - Beyond Jenkins

Version Control

software— in particular, to how we use version control and how we organize our code. Developers should commit changes to their version control system frequently, and split code into separate components as a way of managing large or distributed teams. Branching should, in most

Humble, Jez; Farley, David (2010-07-27). Continuous Delivery: Reliable Software Releases through Build, Test, and Deployment Automation (Addison-Wesley Signature Series (Fowler)) (Kindle Locations 881-883). Pearson Education. Kindle Edition.

Version control triggers builds at Promet

25

Page 27: Drupal Continuous Integration and devops - Beyond Jenkins

Local?

26

Page 28: Drupal Continuous Integration and devops - Beyond Jenkins

CI Servers

27

Page 29: Drupal Continuous Integration and devops - Beyond Jenkins

Agility and Communication in Action

We follow an agile methodology—the industry standard—to manage your web development, which guarantees fast concept-to-market delivery through short development sprints.

This method allows us to receive feedback from our customers early and often,

while adjusting the scope and direction of the project accordingly.

28

Product Backlog

Sprint Backlog

2 Weeks

Application

Page 30: Drupal Continuous Integration and devops - Beyond Jenkins

CI

1. Revision Control2. Build Automation3. Automate Deployment4. Self-Testing Build5. Testing in a Clone of Production6. Frequent Commits7. Code Consolidation8. Fast Builds9. Build Availability

10. Test Result Availability

29

Page 31: Drupal Continuous Integration and devops - Beyond Jenkins

Jenkins

task runner

30

Page 32: Drupal Continuous Integration and devops - Beyond Jenkins

Test Availability

31

Page 33: Drupal Continuous Integration and devops - Beyond Jenkins

https://jenkins2.prometdev.com

32

Page 34: Drupal Continuous Integration and devops - Beyond Jenkins

Code Review

33

Page 35: Drupal Continuous Integration and devops - Beyond Jenkins

Code Evaluation/ReviewAutomated - Code formatting, syntax

34

Page 36: Drupal Continuous Integration and devops - Beyond Jenkins

Performance - not there yet

35

Page 37: Drupal Continuous Integration and devops - Beyond Jenkins

Target Environment Fun

36

Page 38: Drupal Continuous Integration and devops - Beyond Jenkins

Resources

• Vagrant -http://www.vagrantup.com/

• Drupal VM https://www.drupalvm.com/

• Ansible - https://www.ansible.com/

• I strongly recommend Jeff Geerlings book Ansible for Devops

– http://leanpub.com/ansible-for-devops/c/zDAUa4QMP1CL).

• Installing PHPUnit - http://phpunit.de/manual/3.7/en/installation.html

• Jenkins - http://jenkins-ci.org/

37

Page 39: Drupal Continuous Integration and devops - Beyond Jenkins

Resources

● https://github.com/promet/drupal7-framework Promet D7

● Using drush to synchronize and deploy sites -

https://drupal.org/node/670460

● Headless Selenium -https://github.com/generalredneck/headless-selenium

● Behat extension for Drupal -https://drupal.org/project/drupalextension

● PhantomJS - http://phantomjs.org/

38

Page 40: Drupal Continuous Integration and devops - Beyond Jenkins

Resources

39

Page 41: Drupal Continuous Integration and devops - Beyond Jenkins

Thank You

40

CHICAGO, ILLINOIS

1802 W. Berteau Ave. / Suite 209 / Chicago IL, 60613773-525-8255www.prometsource.com

@prometsource @akucharski@johnniefox