Continuous Delivery – Tools - Workflows - Culture



Continuous Delivery – Tools - Workflows - Culture

0 1


presentation-cicd-t3cs2016

My slides about Continuous Delivery at TYPO3 Camp Stuttgart 2016

On Github michaellihs / presentation-cicd-t3cs2016

Continuous Delivery

Tools - Workflows - Culture

Sebastian Helzle

https://github.com/Sebobo@sebobo @punkt_de

Michael Lihs

lihsmi.ch@kaktusmimi @boschglobal

Agenda

  • Introduction
  • Tools
  • Workflow(s)
  • Culture

Continuous Delivery - Why?

Tools - Workflow(s) - Culture

Part 1

Tools

Development Environment

  • VirtualBox
  • Vagrant
  • Proper IDE

Version Control

  • Git
  • Gitlab
  • Sourcetree

Continuous Integration

  • Jenkins
  • Pipeline Plugin
  • Docker for ephemeral build containers

Pipeline Example

    node {

        stage 'Clone from Git'
        git url: 'GIT_URL'

        stage 'Build'
        sh 'composer install'
        sh 'grunt'

        stage 'Unit Tests'
        sh 'phpunit --bootstrap src/autoload.php tests/unit'

        stage 'Deploy to Test'
        sh './flow surf:deploy project'

    }

Pipeline Example

Artifact Storage

  • Artifactory
    • JS / CSS builds
    • PHP packages (composer)
    • Docker Images

Testing

  • PHPUnit
  • Selenium
  • Behat

Delivery (a.k.a. Deployment)

  • Surf
  • Fabric

Environments

  • Integration, Staging, Production
  • Use immutable infrastructure
  • If you really need it, use either
    • Ansible
    • Chef
    • ...
  • But really: use immutable infrastructure

Logging, Monitoring

  • ELK Stack
  • Kibana
  • Dashing

Tools - Overview

Part 2

Workflow(s)

Development Workflow

  • Develop locally
    • Dev Servers are dead
  • Pair Programming
  • Code Review

Version Control

  • Short living feature branches
    • Develop branches are evil
    • Regularly integrate into master
  • Merge Request (Gitlab)
  • Problem: Deliver tasks independently

Merge Request Workflow

  • Create a feature branch (PRJ-123)
  • Implement your feature
  • Push branch to Gitlab server
  • Create merge request
  • Assign it to your colleague
  • Merge or decline

Feedback Loops

Feedback Loops

  • Establish a Continuous Delivery pipeline
  • Separate stages from fast to slow(er)
    • Run tests locally (before push)
    • Build on CI server
    • Run Unit Tests
    • Run Integration Tests
    • ...
    • Deploy to Staging
    • Deploy to Production

Do NOT program on the CI Server

  • Use pipeline plugin
  • Make build pipeline part of project
    • Write a (simple) script
    • Version it

Do not run jobs on Jenkins Master

  • Use agents
  • Run agents in short living (ephemeral) containers
  • Separate build environments
  • Provide greenfield to each build

Build once, use everywhere

  • Make builds traceable
  • Do not build things more than once
  • Build an re-use

Part 3

Culture

Feedback

  • Personal Feedback
    • Pairing - close session with feedback
    • Retrospectives
    • Customer feedback
    • User feedback
  • Automated Feedback
    • Tests
    • Monitoring

KISS

  • Keep It Simple Stupid
  • Strive for understanding
  • Make whole team understand the toolchain
  • Motivate by simplicity not by complexity

Prodcut Thinking

over Project Thinking

  • Cross-functional teams
  • Create value for customer, not just finish projects
  • Support and re-think supporting business process
  • Take responsibility for success of product

Strive for Agility

  • Individuals and interactions >> processes and tools
    • Stable teams
    • Iteratively develop and track processes
  • Working software >> comprehensive documentation
    • Convention over documentation
    • Frameworks, well-known software and tools

Strive for Agility

  • Customer collaboration >> contract negotiation
    • Include customer in planning and review (and retrospectives?)
    • Provide access to JIRA, test system, monitoring, test results
  • Respond to change >> follow a plan
    • Small batches, iterations
    • Get changes on the road quickly
    • Incorporate customer and user feedback

Thank You!

Slides: http://michaellihs.github.io/presentation-cicd-t3cs2016/

by Dani

References

TODOs

  • Add goals for Dev Environment
    • Be as close to production as possible
  • Add example for Behat tests
  • Add slide about traceability
  • Provide images for collaboration models
    • cross-functional teams
    • devops teams
  • Add some information about (Jenkins) notifications
  • Add blue-green deployment
  • Add further ideas for imm. infrastrct
  • Refine image for CD
  • Refine tools overview image
    • Monitoring
    • Dashboards
  • RFT idea: show workflow based on "real world example"
    • how to add a feature
Continuous DeliveryTools - Workflows - Culture