SlideShare una empresa de Scribd logo
1 de 29
Docker & Jenkins Pipeline
Continuous Integration – Mark Waite
Mile High Agile 2018
The
Intersection
Accident
Problem
Accidents frequently happen
at intersections
The Software Integration Problem
Merge
Team 1
Team 2
Team 3
• Integration frequently fails
• Conflicting changes
• Misunderstood requirements
• Missed capabilities
• Larger integrations fail more
Integration surprises
• Frequently surprised
• That should have worked
• Works on my machine
• Why would anyone do that?
• That’s a feature, not a bug
• …
The
Intersection
Accident
Solution
Roundabouts have
fewer accidents and
less severe accidents
The Software Integration Solution
• Integrate frequently • Combine changes often
• Evaluate changes often
• Detect issues early
Merge
Team 1
Team 2
Team 3
Merge
Team 1
Team 2
Team 3
Merge
Team 1
Team 2
Team 3
Merge
Team 1
Team 2
Team 3
Merge
Team 1
Team 2
Team 3
Implementation: Meet the Red Team
• Goal: Deliver great software from a happy team
• Integrate
• Build
• Test
• Deliver
• Find failures sooner, faster
Red Team Uses Jenkins Pipeline
• Jenkins Continuous Integration
• Open source
• Full-featured
• Scalable
• Powerful
• Easy to configure
Red Team Demo – Jenkins Pipeline
• Red Team finds team level problems sooner
• Conflicts discovered earlier
• Missed requirements identified sooner
• Integration is less painful because it is more frequent
Meet Ms. Green and Mrs. Black
• Red team members
• Ms. Green
• Mrs. Black
• Find problems sooner
Merge
Ms. Green
Red Team
Mrs. Black
What if I could find
problems before merge?
Check Proposed Changes
• Detect conflicts before merge
• Run tests before code review
• Try Pipeline improvements
Merge
Ms. Green
Red Team
Mrs. Black
What if I could find
problems before merge?
Red Team Uses Jenkins Multi-branch Pipeline
• Multi-branch Pipeline
• Domain specific language (DSL)
• Developer defined and modified
• Stored with the source code
• Job per branch
• Jobs created automatically
• Jobs destroyed automatically
pipeline {
agent any
stages {
stage('Build') {
steps {
sh 'make package'
}
}
}
}
Multi-branch Jenkins Pipeline Demo
• Ms. Green and Mrs. Black finds problems sooner
• Private merge of proposed change
• Merge conflicts detected
• Tests run before code review
The
Unintended
Variation
Problem
Surprises aren’t always happy
This Photo by BlarSnow is licensed under CC BY-SA
Variation in Software Development
• Good: Intentional Variation
• Platform specific build
• Multi-platform tests
• Web browser tests
• Low bandwidth tests
This icon by Sean Martell is
licensed under CC BY-SA
Variation in Software Development
• Bad: Unintentional Variation
• Wrong build tools
• Outdated dependencies
• Contaminated tests
• Full file systems
Reducing Unintentional Variation with Docker
• Docker Containers
• Repeatable
• Isolated file system
• Isolated process - lightweight
• Open source
Building with Docker – Apache Maven
• Java 7, latest Maven 3
• docker run maven:3-jdk-7 mvn –v
• Java 8, latest Maven 3
• docker run maven:3-jdk-8 mvn –v
• Java 9, latest Maven 3
• docker run maven:3-jdk-9 mvn –v
• Java 10, latest Maven 3
• docker run maven:3-jdk-10 mvn -v
• Java 11, latest Maven 3
• docker run maven:3-jdk-11 mvn -v
See https://hub.docker.com/_/maven/ for more command line details
Building with Docker – Gradle
• Java 8, Gradle 4.7.0
• docker run gradle:4.7.0-jre8 gradle –-version
• Java 9, Gradle 4.7.0
• docker run gradle:4.7.0-jre9 gradle –-version
• Java 10, Gradle 4.7.0
• docker run gradle:4.7.0-jre10 gradle –-version
See https://hub.docker.com/_/gradle/ for more command line details
Define Your Own Toolchain
• Dockerfile specifies
• Operating system (CentOS, Debian, Red Hat, SUSE, Ubuntu, …)
• Packages
• File system contents
• Volume mount points (reuse, persistence across run, etc.)
Build with Docker
• Repeatable builds in precisely defined environment
• Specify exact tool versions in Dockerfile
• Clean file system is easy
• Examples
• I need gcc 6.1 and go 1.8, they need gcc 4.3 and java 1.8
• Both can be satisfied by each compiling from a purpose-built docker image
• I need specific library versions, they need different versions
• Both satisfied by their own Dockerfile
Docker for Unit and Integration Tests
Fewer environment surprises
Docker for Better Unit & Integration Testing
• Docker provides more consistent runtime
• Reduce differences between test environments
• Examples
• Unit tests run in Docker start from a clean state
• Test environment cleanup is simpler
Specific Example – Jenkins Test Harness
• Jenkins test harness uses a specific named temporary directory
• Multiple users on same machine cannot use same directory
• Docker file system isolation solves it
Docker for End to End Tests
Rapid configuration of complex scenarios
Docker for Better End to End Testing
• Docker automates complicated configuration
• Repeatable test environment creation
• Compose multi-component test configurations
• Spend less time configuring test environments
• Spend more time testing
• Examples:
• Jenkins LTS with plugins
• https://github.com/MarkEWaite/docker-lfs/tree/lts-with-plugins
Docker for Bug Reports
Repeatable environments in the bug report
Docker for Better Bug Reports
• Simplify long sequences of pre-conditions in Dockerfile
• Focus the report on specific bug details
• Simplify setup for bug fixer
• Some examples:
• JENKINS-41948 – noSuchMethodError in scanning
• JENKINS-42204 – NPE due to GitSCMSource change
• JENKINS-46724 – Illegal reflective access from remoting
Docker & Jenkins Together
• Jenkins for Pipeline as code
• Docker for infrastructure as code

Más contenido relacionado

La actualidad más candente

Automated Deployment Pipeline using Jenkins, Puppet, Mcollective and AWS
Automated Deployment Pipeline using Jenkins, Puppet, Mcollective and AWSAutomated Deployment Pipeline using Jenkins, Puppet, Mcollective and AWS
Automated Deployment Pipeline using Jenkins, Puppet, Mcollective and AWS
Bamdad Dashtban
 
2013 10-28 php ug presentation - ci using phing and hudson
2013 10-28 php ug presentation - ci using phing and hudson2013 10-28 php ug presentation - ci using phing and hudson
2013 10-28 php ug presentation - ci using phing and hudson
Shreeniwas Iyer
 

La actualidad más candente (20)

An Open-Source Chef Cookbook CI/CD Implementation Using Jenkins Pipelines
An Open-Source Chef Cookbook CI/CD Implementation Using Jenkins PipelinesAn Open-Source Chef Cookbook CI/CD Implementation Using Jenkins Pipelines
An Open-Source Chef Cookbook CI/CD Implementation Using Jenkins Pipelines
 
7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins Users7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins Users
 
Building an Extensible, Resumable DSL on Top of Apache Groovy
Building an Extensible, Resumable DSL on Top of Apache GroovyBuilding an Extensible, Resumable DSL on Top of Apache Groovy
Building an Extensible, Resumable DSL on Top of Apache Groovy
 
JavaOne 2016 - Pipeline as code
JavaOne 2016 - Pipeline as codeJavaOne 2016 - Pipeline as code
JavaOne 2016 - Pipeline as code
 
(Declarative) Jenkins Pipelines
(Declarative) Jenkins Pipelines(Declarative) Jenkins Pipelines
(Declarative) Jenkins Pipelines
 
Pipeline based deployments on Jenkins
Pipeline based deployments  on JenkinsPipeline based deployments  on Jenkins
Pipeline based deployments on Jenkins
 
Achieving Full Stack DevOps at Colonial Life
Achieving Full Stack DevOps at Colonial Life Achieving Full Stack DevOps at Colonial Life
Achieving Full Stack DevOps at Colonial Life
 
Stop Being Lazy and Test Your Software
Stop Being Lazy and Test Your SoftwareStop Being Lazy and Test Your Software
Stop Being Lazy and Test Your Software
 
Jfokus 2017 - The DevOps Disaster
Jfokus 2017 - The DevOps Disaster Jfokus 2017 - The DevOps Disaster
Jfokus 2017 - The DevOps Disaster
 
Pipeline as code using Jenkins -Ministry of Testing
Pipeline as code using Jenkins -Ministry of TestingPipeline as code using Jenkins -Ministry of Testing
Pipeline as code using Jenkins -Ministry of Testing
 
7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins Users7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins Users
 
Ci jenkins maven svn
Ci jenkins maven svnCi jenkins maven svn
Ci jenkins maven svn
 
Use Docker to Enhance Your Testing
Use Docker to Enhance Your TestingUse Docker to Enhance Your Testing
Use Docker to Enhance Your Testing
 
Jenkins presentation
Jenkins presentationJenkins presentation
Jenkins presentation
 
Building Jenkins Pipelines at Scale
Building Jenkins Pipelines at ScaleBuilding Jenkins Pipelines at Scale
Building Jenkins Pipelines at Scale
 
Jenkins introduction
Jenkins introductionJenkins introduction
Jenkins introduction
 
Jenkins Pipelines
Jenkins PipelinesJenkins Pipelines
Jenkins Pipelines
 
Automated Deployment Pipeline using Jenkins, Puppet, Mcollective and AWS
Automated Deployment Pipeline using Jenkins, Puppet, Mcollective and AWSAutomated Deployment Pipeline using Jenkins, Puppet, Mcollective and AWS
Automated Deployment Pipeline using Jenkins, Puppet, Mcollective and AWS
 
2013 10-28 php ug presentation - ci using phing and hudson
2013 10-28 php ug presentation - ci using phing and hudson2013 10-28 php ug presentation - ci using phing and hudson
2013 10-28 php ug presentation - ci using phing and hudson
 
Jenkins, pipeline and docker
Jenkins, pipeline and docker Jenkins, pipeline and docker
Jenkins, pipeline and docker
 

Similar a Docker and Jenkins Pipeline

Similar a Docker and Jenkins Pipeline (20)

MyHeritage - QA Automations in a Continuous Deployment environment
MyHeritage -  QA Automations in a Continuous Deployment environmentMyHeritage -  QA Automations in a Continuous Deployment environment
MyHeritage - QA Automations in a Continuous Deployment environment
 
MyHeritage - End 2 End testing Infra
MyHeritage - End 2 End testing InfraMyHeritage - End 2 End testing Infra
MyHeritage - End 2 End testing Infra
 
Efficient Parallel Testing with Docker
Efficient Parallel Testing with DockerEfficient Parallel Testing with Docker
Efficient Parallel Testing with Docker
 
Introduction to jenkins
Introduction to jenkinsIntroduction to jenkins
Introduction to jenkins
 
Test parallelization using Jenkins
Test parallelization using JenkinsTest parallelization using Jenkins
Test parallelization using Jenkins
 
Efficient Parallel Testing with Docker by Laura Frank
Efficient Parallel Testing with Docker by Laura FrankEfficient Parallel Testing with Docker by Laura Frank
Efficient Parallel Testing with Docker by Laura Frank
 
Continuous Integration - Mobile Practice
Continuous Integration - Mobile PracticeContinuous Integration - Mobile Practice
Continuous Integration - Mobile Practice
 
CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...
CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...
CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...
 
Make It Cooler: Using Decentralized Version Control
Make It Cooler: Using Decentralized Version ControlMake It Cooler: Using Decentralized Version Control
Make It Cooler: Using Decentralized Version Control
 
Improving WordPress Development and Deployments with Docker
Improving WordPress Development and Deployments with DockerImproving WordPress Development and Deployments with Docker
Improving WordPress Development and Deployments with Docker
 
Automated Testing with Docker on Steroids - nlOUG TechExperience 2018 (Amersf...
Automated Testing with Docker on Steroids - nlOUG TechExperience 2018 (Amersf...Automated Testing with Docker on Steroids - nlOUG TechExperience 2018 (Amersf...
Automated Testing with Docker on Steroids - nlOUG TechExperience 2018 (Amersf...
 
AWS re:Invent 2016: Development Workflow with Docker and Amazon ECS (CON302)
AWS re:Invent 2016: Development Workflow with Docker and Amazon ECS (CON302)AWS re:Invent 2016: Development Workflow with Docker and Amazon ECS (CON302)
AWS re:Invent 2016: Development Workflow with Docker and Amazon ECS (CON302)
 
Verifying your Ansible Roles using Docker, Test Kitchen and Serverspec
Verifying your Ansible Roles using Docker, Test Kitchen and ServerspecVerifying your Ansible Roles using Docker, Test Kitchen and Serverspec
Verifying your Ansible Roles using Docker, Test Kitchen and Serverspec
 
Gradle 2.Write once, builde everywhere
Gradle 2.Write once, builde everywhereGradle 2.Write once, builde everywhere
Gradle 2.Write once, builde everywhere
 
Dockerizing Python Applications
Dockerizing Python ApplicationsDockerizing Python Applications
Dockerizing Python Applications
 
Devops - why, what and how?
Devops - why, what and how?Devops - why, what and how?
Devops - why, what and how?
 
Tuenti Release Workflow
Tuenti Release WorkflowTuenti Release Workflow
Tuenti Release Workflow
 
Performance Tuning in the Trenches
Performance Tuning in the TrenchesPerformance Tuning in the Trenches
Performance Tuning in the Trenches
 
ExpoQA 2017 Docker and CI
ExpoQA 2017 Docker and CIExpoQA 2017 Docker and CI
ExpoQA 2017 Docker and CI
 
Docker & ci
Docker & ciDocker & ci
Docker & ci
 

Más de Mark Waite

Jenkins - Continuous Integration after Hudson, CruiseControl, and home built
Jenkins - Continuous Integration after Hudson, CruiseControl, and home builtJenkins - Continuous Integration after Hudson, CruiseControl, and home built
Jenkins - Continuous Integration after Hudson, CruiseControl, and home built
Mark Waite
 

Más de Mark Waite (9)

Training as Code - Applying CI/CD to training
Training as Code - Applying CI/CD to trainingTraining as Code - Applying CI/CD to training
Training as Code - Applying CI/CD to training
 
Docker and Jenkins [as code]
Docker and Jenkins [as code]Docker and Jenkins [as code]
Docker and Jenkins [as code]
 
Thinking about Jenkins Security
Thinking about Jenkins SecurityThinking about Jenkins Security
Thinking about Jenkins Security
 
Lessons from Jenkins Platform Support
Lessons from Jenkins Platform SupportLessons from Jenkins Platform Support
Lessons from Jenkins Platform Support
 
Git for jenkins faster and better
Git for jenkins   faster and betterGit for jenkins   faster and better
Git for jenkins faster and better
 
To TDD or not to TDD - that is the question
To TDD or not to TDD - that is the questionTo TDD or not to TDD - that is the question
To TDD or not to TDD - that is the question
 
Git in-the-large
Git in-the-largeGit in-the-large
Git in-the-large
 
Jenkins - Continuous Integration after Hudson, CruiseControl, and home built
Jenkins - Continuous Integration after Hudson, CruiseControl, and home builtJenkins - Continuous Integration after Hudson, CruiseControl, and home built
Jenkins - Continuous Integration after Hudson, CruiseControl, and home built
 
Jenkins For One
Jenkins For OneJenkins For One
Jenkins For One
 

Último

+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
masabamasaba
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
masabamasaba
 

Último (20)

WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 

Docker and Jenkins Pipeline

  • 1. Docker & Jenkins Pipeline Continuous Integration – Mark Waite Mile High Agile 2018
  • 3. The Software Integration Problem Merge Team 1 Team 2 Team 3 • Integration frequently fails • Conflicting changes • Misunderstood requirements • Missed capabilities • Larger integrations fail more
  • 4. Integration surprises • Frequently surprised • That should have worked • Works on my machine • Why would anyone do that? • That’s a feature, not a bug • …
  • 6. The Software Integration Solution • Integrate frequently • Combine changes often • Evaluate changes often • Detect issues early Merge Team 1 Team 2 Team 3 Merge Team 1 Team 2 Team 3 Merge Team 1 Team 2 Team 3 Merge Team 1 Team 2 Team 3 Merge Team 1 Team 2 Team 3
  • 7. Implementation: Meet the Red Team • Goal: Deliver great software from a happy team • Integrate • Build • Test • Deliver • Find failures sooner, faster
  • 8. Red Team Uses Jenkins Pipeline • Jenkins Continuous Integration • Open source • Full-featured • Scalable • Powerful • Easy to configure
  • 9. Red Team Demo – Jenkins Pipeline • Red Team finds team level problems sooner • Conflicts discovered earlier • Missed requirements identified sooner • Integration is less painful because it is more frequent
  • 10. Meet Ms. Green and Mrs. Black • Red team members • Ms. Green • Mrs. Black • Find problems sooner Merge Ms. Green Red Team Mrs. Black What if I could find problems before merge?
  • 11. Check Proposed Changes • Detect conflicts before merge • Run tests before code review • Try Pipeline improvements Merge Ms. Green Red Team Mrs. Black What if I could find problems before merge?
  • 12. Red Team Uses Jenkins Multi-branch Pipeline • Multi-branch Pipeline • Domain specific language (DSL) • Developer defined and modified • Stored with the source code • Job per branch • Jobs created automatically • Jobs destroyed automatically pipeline { agent any stages { stage('Build') { steps { sh 'make package' } } } }
  • 13. Multi-branch Jenkins Pipeline Demo • Ms. Green and Mrs. Black finds problems sooner • Private merge of proposed change • Merge conflicts detected • Tests run before code review
  • 14. The Unintended Variation Problem Surprises aren’t always happy This Photo by BlarSnow is licensed under CC BY-SA
  • 15. Variation in Software Development • Good: Intentional Variation • Platform specific build • Multi-platform tests • Web browser tests • Low bandwidth tests This icon by Sean Martell is licensed under CC BY-SA
  • 16. Variation in Software Development • Bad: Unintentional Variation • Wrong build tools • Outdated dependencies • Contaminated tests • Full file systems
  • 17. Reducing Unintentional Variation with Docker • Docker Containers • Repeatable • Isolated file system • Isolated process - lightweight • Open source
  • 18. Building with Docker – Apache Maven • Java 7, latest Maven 3 • docker run maven:3-jdk-7 mvn –v • Java 8, latest Maven 3 • docker run maven:3-jdk-8 mvn –v • Java 9, latest Maven 3 • docker run maven:3-jdk-9 mvn –v • Java 10, latest Maven 3 • docker run maven:3-jdk-10 mvn -v • Java 11, latest Maven 3 • docker run maven:3-jdk-11 mvn -v See https://hub.docker.com/_/maven/ for more command line details
  • 19. Building with Docker – Gradle • Java 8, Gradle 4.7.0 • docker run gradle:4.7.0-jre8 gradle –-version • Java 9, Gradle 4.7.0 • docker run gradle:4.7.0-jre9 gradle –-version • Java 10, Gradle 4.7.0 • docker run gradle:4.7.0-jre10 gradle –-version See https://hub.docker.com/_/gradle/ for more command line details
  • 20. Define Your Own Toolchain • Dockerfile specifies • Operating system (CentOS, Debian, Red Hat, SUSE, Ubuntu, …) • Packages • File system contents • Volume mount points (reuse, persistence across run, etc.)
  • 21. Build with Docker • Repeatable builds in precisely defined environment • Specify exact tool versions in Dockerfile • Clean file system is easy • Examples • I need gcc 6.1 and go 1.8, they need gcc 4.3 and java 1.8 • Both can be satisfied by each compiling from a purpose-built docker image • I need specific library versions, they need different versions • Both satisfied by their own Dockerfile
  • 22. Docker for Unit and Integration Tests Fewer environment surprises
  • 23. Docker for Better Unit & Integration Testing • Docker provides more consistent runtime • Reduce differences between test environments • Examples • Unit tests run in Docker start from a clean state • Test environment cleanup is simpler
  • 24. Specific Example – Jenkins Test Harness • Jenkins test harness uses a specific named temporary directory • Multiple users on same machine cannot use same directory • Docker file system isolation solves it
  • 25. Docker for End to End Tests Rapid configuration of complex scenarios
  • 26. Docker for Better End to End Testing • Docker automates complicated configuration • Repeatable test environment creation • Compose multi-component test configurations • Spend less time configuring test environments • Spend more time testing • Examples: • Jenkins LTS with plugins • https://github.com/MarkEWaite/docker-lfs/tree/lts-with-plugins
  • 27. Docker for Bug Reports Repeatable environments in the bug report
  • 28. Docker for Better Bug Reports • Simplify long sequences of pre-conditions in Dockerfile • Focus the report on specific bug details • Simplify setup for bug fixer • Some examples: • JENKINS-41948 – noSuchMethodError in scanning • JENKINS-42204 – NPE due to GitSCMSource change • JENKINS-46724 – Illegal reflective access from remoting
  • 29. Docker & Jenkins Together • Jenkins for Pipeline as code • Docker for infrastructure as code

Notas del editor

  1. We’ve found through years of driving automobiles that accidents happen more frequently at intersections than on long straight stretches.
  2. Tell the story of the wooden trivet. Wooden trivet looks like it should assemble in either direction. Legs appear consistently sized, finish is consistent, and it looks reasonable Inverted parts do not assemble cleanly, no matter how much they look like they will.
  3. A birthday gift is an intentional surprise. We laugh and smile and enjoy the experience of being surprised by the contents of that beautifully wrapped package. The gift is a source of joy and fun
  4. Intentional variation in software development happens all the time. We develop for multiple platforms. We test on multiple platforms. We develop for multiple browsers. We test our mobile apps in low bandwidth environments. Those can all be good variations in software development. They help us create great software.
  5. Unfortunately, some variation can delay or derail software creation. When we build with the wrong tool, we may get the wrong results. When we use outdated dependencies, we may have bugs we did not expect. When unexpected files on a test system alter the behavior of the test, we may miss important bugs. When a build system or a test system runs out of space, we may waste time diagnosing irrelevant failures
  6. Describe a brief history of containers, Solaris and BSD as jails, then Linux with greater ease and more capabilities.