Drupal Continuous Integration and devops - Beyond Jenkins

Preview:

Citation preview

Lessons Learned

Predictable ContinuousDeployment

DrualCorn August 2016

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

2

What this Presentation is not about

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

3

About Us

Who are we?

4

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.

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.

7

Who Are You?

Why should you care about CI/CD

8

9

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

Common Antipatterns

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

Development is Complete• Manual Configuration Management of Production

Environments

11

12

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

Organizational Benefits

14

State of DevOps report 2016

15

State of DevOps report 2016

16

State of DevOps report 2016

17

18

19

The Predictable Continuous Deployment

Predictable CI at Promet

20

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

A Brief History

22

A Brief History?

23

GITFeaturesBash VagrantEnvironmentsAnsibleGitflowJenkinsComposerCodesnifferBehat

GITFeaturesBash VagrantEnvironmentsAnsibleGitflowJenkins

GITFeaturesBash EnvironmentsChefVagrantGitflow

GITFeaturesChefUpdate scriptsBashGitflow

GITFeaturesChef

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

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

Local?

26

CI Servers

27

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

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

Jenkins

task runner

30

Test Availability

31

https://jenkins2.prometdev.com

32

Code Review

33

Code Evaluation/ReviewAutomated - Code formatting, syntax

34

Performance - not there yet

35

Target Environment Fun

36

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

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

Resources

39

Thank You

40

CHICAGO, ILLINOIS

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

@prometsource @akucharski@johnniefox

Recommended