Lessons Learned
Predictable Continuous
Deployment
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. DISCOVERY
You 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. DESIGN
There 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. DEVELOPMENT
Build 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’t
fade into the background.
4. SUPPORT
Your 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 INDUSTRY
Promet 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 RESULT
Grow your donor base or enhance your
lead generation pipeline. Promet’s
solutions 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
GIT
Features
Bash
Vagrant
Environments
Ansible
Gitflow
Jenkins
Composer
Codesniffer
Behat
GIT
Features
Bash
Vagrant
Environments
Ansible
Gitflow
Jenkins
GIT
Features
Bash
Environments
Chef
Vagrant
Gitflow
GIT
Features
Chef
Update scripts
Bash
Gitflow
GIT
Features
Chef
CI Principles
Continuous Integration 10 Principles
1. Revision Control
2. Build Automation
3. Automate Deployment
4. Self-Testing Build
5. Testing in a Clone of Production
6. Frequent Commits
7. Code Consolidation
8. Fast Builds
9. 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 Control
2. Build Automation
3. Automate Deployment
4. Self-Testing Build
5. Testing in a Clone of Production
6. Frequent Commits
7. Code Consolidation
8. Fast Builds
9. Build Availability
10. Test Result Availability
29
Jenkins
task runner
30
Test Availability
31
https://jenkins2.prometdev.com
32
Code Review
33
Code Evaluation/Review
Automated - 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, 60613
773-525-8255
www.prometsource.com
@prometsource @akucharski
@johnniefox

Drupal Continuous Integration and devops - Beyond Jenkins

  • 1.
  • 2.
    1 2 3 1 Agenda Lessons in doingthings the wrong way Components of Good Predictable Continuous Deployment How do we do it with Drupal
  • 3.
    2 What this Presentationis not about • Tools • Code Examples • Specific Prescribed Framework (BLT, etc.)
  • 4.
  • 5.
  • 6.
    WE PROVIDE SOLUTIONSWITH 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.
  • 7.
    SERVICES SOLUTIONS THE ROADMAPTO RESULTS 6 1. DISCOVERY You 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. DESIGN There 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. DEVELOPMENT Build 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’t fade into the background. 4. SUPPORT Your 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 INDUSTRY Promet 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 RESULT Grow your donor base or enhance your lead generation pipeline. Promet’s solutions are fed by our deep understanding of eCommerce implementations and automated marketing systems integration within Drupal.
  • 8.
  • 9.
    Why should youcare about CI/CD 8
  • 10.
  • 11.
    Goal There should betwo 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
  • 12.
    Common Antipatterns • DeployingSoftware Manually • Deploying to a Production-like environment Only after Development is Complete • Manual Configuration Management of Production Environments 11
  • 13.
  • 14.
    Principles of SoftwareDelivery • 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
  • 15.
  • 16.
    State of DevOpsreport 2016 15
  • 17.
    State of DevOpsreport 2016 16
  • 18.
    State of DevOpsreport 2016 17
  • 19.
  • 20.
  • 21.
  • 22.
    Local Development DevelopmentStaging 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
  • 23.
  • 24.
  • 25.
    CI Principles Continuous Integration10 Principles 1. Revision Control 2. Build Automation 3. Automate Deployment 4. Self-Testing Build 5. Testing in a Clone of Production 6. Frequent Commits 7. Code Consolidation 8. Fast Builds 9. Build Availability 10. Test Result Availability 24
  • 26.
    Version Control software— inparticular, 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
  • 27.
  • 28.
  • 29.
    Agility and Communicationin 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
  • 30.
    CI 1. Revision Control 2.Build Automation 3. Automate Deployment 4. Self-Testing Build 5. Testing in a Clone of Production 6. Frequent Commits 7. Code Consolidation 8. Fast Builds 9. Build Availability 10. Test Result Availability 29
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
    Code Evaluation/Review Automated -Code formatting, syntax 34
  • 36.
    Performance - notthere yet 35
  • 37.
  • 38.
    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
  • 39.
    Resources ● https://github.com/promet/drupal7-framework PrometD7 ● 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
  • 40.
  • 41.
    Thank You 40 CHICAGO, ILLINOIS 1802W. Berteau Ave. / Suite 209 / Chicago IL, 60613 773-525-8255 www.prometsource.com @prometsource @akucharski @johnniefox