SlideShare a Scribd company logo
THE ROAD TO CONTINUOUS
DEPLOYMENT - A CASE STUDY
MICHIEL ROOK
▸ Java, PHP & Scala developer
▸ Consultant, trainer, speaker
▸ make.io
▸ Dutch Web Alliance
▸ Maintainer of Phing
▸ @michieltcs
THIS TALK
▸ Background
▸ The approach
▸ Process / standards
▸ Build pipelines
▸ Results & lessons learned
The road to continuous deployment (DomCode September 2016)
THE SYSTEM - SAN DIEGO
▸ ... or the Big Ball Of Mud
▸ Large legacy monolith
▸ Generates significant income
▸ Slow & complex
▸ Technical debt
SAN DIEGO
FRONTEND
MYSQL
DB
SAN DIEGO
BACKEND
LOAD BALANCERS / VARNISH
ITBANEN INTERMEDIAIR NATIONALEVACATUREBANK
SAN DIEGO
FRONTEND
SAN DIEGO
FRONTEND
SAN DIEGO
FRONTEND
SAN DIEGO
BACKEND
SAN DIEGO
BACKEND
SAN DIEGO
BACKEND
MEMCACHE FTP
EXT.
SERVICES
SOLR
THE SYSTEM - SAN DIEGO
▸ Infrequent, manual releases
▸ Fragile tests
▸ Low velocity
▸ Frequent outages / bugs / issues
▸ Frustrated team
▸ Low confidence modifying existing code
GOALS
▸ Reduce issues
▸ Reduce cycle time
▸ Increase productivity
▸ Increase motivation
REFACTOR? REBUILD?
APPROACH
▸ Services per domain object
(job, jobseeker, ...)
▸ Strangler pattern
▸ Proxy to switch between
old/new
▸ Migrate individual pages
ORIGINAL
MONOLITH
PROXY
SERVICE
ORIGINAL
MONOLITH
ORIGINAL
MONOLITH
SERVICE SERVICE
SERVICE
PROXY
DB
DB
DB
DB
DB DB
APPROACH
▸ Services behind load balancers
▸ Access legacy db’s
▸ Continuous deployment
▸ Docker containers
▸ Frontends are services
SAN DIEGO
ELASTIC
SEARCHLEGACY
DB
JOB
SERVICE
RMQ
ITBANEN INTERMEDIAIR NATIONALEVACATUREBANK
MONGO
DB
ITBANEN
JOBSEEKER
SERVICE
NVBINTERMEDIAI
PROCESS
STARTING OFF
▸ Scrum, 1 week sprints
▸ TDD / BDD
▸ Definition of Done
▸ Team mindset / experience
▸ Focus on value
▸ Replace old features with new (legacy becomes obsolete)
CONTINUOUS EVERYTHING
DEV BUILD / TEST
CONTINUOUS INTEGRATION
DEV BUILD / TEST ACCEPTANCE PRODUCTION
CONTINUOUS DELIVERY
DEV BUILD / TEST ACCEPTANCE PRODUCTION
CONTINUOUS DEPLOYMENT
WHY CONTINUOUS DEPLOYMENT
▸ Small steps
▸ Early feedback
▸ Less overhead
▸ Reduce cycle time
▸ Reduce risk
ONLY COMMIT TO MASTER
NO BRANCHES
NO BRANCHES
REALLY.
PAIR PROGRAMMING
BOY SCOUT RULE
QUALITY GATES
100% CODE COVERAGE*
FEATURE TOGGLES, A/B TESTS
DASHBOARDS
BUILD

PIPELINE
AUTOMATE REPEATABLE THINGS
EVERY COMMIT GOES TO
PRODUCTION
DEFENSE IN DEPTH
UNIT TESTS
INTEGRATION

TESTS
ACCEPTANCE

TESTS
UI TESTS
DEFENSE IN DEPTH
UNIT TESTS
INTEGRATION

TESTS
ACCEPTANCE
UI TESTS
public function testJobCannotBeFound() {

$jobRepository = $this->prophesize(JobRepository::class);

$jobRepository->getById(EXPECTED_JOB_ID)

->shouldBeCalled()

->willReturn(false);



$jobService = new JobService($jobRepository->reveal());



$this->assertFalse($jobService->getById(EXPECTED_JOB_ID));

}
DEFENSE IN DEPTH
UNIT TESTS
INTEGRATION

TESTS
ACCEPTANCE

TESTS
UI TESTS
public function testFindJob() {

$expectedJob = $this->loadFixture('active_job.yml');

$actualJob = $this->repository->getById($expectedJob->getId());



self::assertInstanceOf(Job::class, $actualJob);

self::assertEquals($expectedJob->getId(), $actualJob->getId());

}
DEFENSE IN DEPTH
UNIT TESTS
INTEGRATION

TESTS
ACCEPTANCE

TESTS
UI TESTSScenario: Link to related job

Given a job exists

And there are related jobs available

When that job is viewed

Then a list of related jobs is shown

And each related job links to the detail page of the related job
DEFENSE IN DEPTH
UNIT TESTS
INTEGRATION

TESTS
ACCEPTANCE

TESTS
UI TESTS
DEFENSE IN DEPTH
MANUAL
TESTING?
UNIT TESTS
INTEGRATION

TESTS
ACCEPTANCE

TESTS
UI
CONTINUOUS TESTING
UNIT TESTS
INTEGRATION TESTS
ACCEPTANCE TESTS
UI TESTS
SMOKE

TESTS
Cost Speed
Exploratory

testing
Monitoring
DEPLOYING
PULL IMAGE
START NEW CONTAINER
WAIT FOR PORT
SMOKE TESTS / HEALTH CHECKS
ADD NEW CONTAINER TO LB
REMOVE OLD CONTAINER FROM LB
STOP OLD CONTAINER
DEPLOYING
PULL IMAGE
START NEW CONTAINER
WAIT FOR PORT
SMOKE TESTS / HEALTH CHECKS
ADD NEW CONTAINER TO LB
REMOVE OLD CONTAINER FROM LB
STOP OLD CONTAINER
docker pull
DEPLOYING
PULL IMAGE
START NEW CONTAINER
WAIT FOR PORT
SMOKE TESTS / HEALTH CHECKS
ADD NEW CONTAINER TO LB
REMOVE OLD CONTAINER FROM LB
STOP OLD CONTAINER
docker run
DEPLOYING
PULL IMAGE
START NEW CONTAINER
WAIT FOR PORT
SMOKE TESTS / HEALTH CHECKS
ADD NEW CONTAINER TO LB
REMOVE OLD CONTAINER FROM LB
STOP OLD CONTAINER
wait_for: port=8080 delay=5 timeout=15
DEPLOYING
PULL IMAGE
START NEW CONTAINER
WAIT FOR PORT
SMOKE TESTS / HEALTH CHECKS
ADD NEW CONTAINER TO LB
REMOVE OLD CONTAINER FROM LB
STOP OLD CONTAINER
uri:

url: http://localhost:8080/_health

status_code: 200

timeout: 30
DEPLOYING
PULL IMAGE
START NEW CONTAINER
WAIT FOR PORT
SMOKE TESTS / HEALTH CHECKS
ADD NEW CONTAINER TO LB
REMOVE OLD CONTAINER FROM LB
STOP OLD CONTAINER
template: src=haproxy.cfg.j2

dest=/etc/haproxy/haproxy.cfg
service: name=haproxy state=reloaded
DEPLOYING
PULL IMAGE
START NEW CONTAINER
WAIT FOR PORT
SMOKE TESTS / HEALTH CHECKS
ADD NEW CONTAINER TO LB
REMOVE OLD CONTAINER FROM LB
STOP OLD CONTAINER
template: src=haproxy.cfg.j2

dest=/etc/haproxy/haproxy.cfg
service: name=haproxy state=reloaded
DEPLOYING
PULL IMAGE
START NEW CONTAINER
WAIT FOR PORT
SMOKE TESTS / HEALTH CHECKS
ADD NEW CONTAINER TO LB
REMOVE OLD CONTAINER FROM LB
STOP OLD CONTAINER
docker stop
docker rm
PIPELINE AS CODE
node {

stage 'Run tests'

sh "phpunit"

sh "behat"



stage 'Build docker image'

sh "phing build"

sh "docker build -t jobservice:${env.BUILD_NUMBER} ."

sh "docker push jobservice:${env.BUILD_NUMBER}"



stage 'Deploy acceptance'

sh "ansible-playbook -e BUILD_NUMBER=${env.BUILD_NUMBER} -i acc deploy.yml"



stage 'Deploy production'

sh "ansible-playbook -e BUILD_NUMBER=${env.BUILD_NUMBER} -i prod deploy.yml"

}
BUILD PIPELINE
FEEDBACK!
RESULTS
RESULTS
▸ Total build time per service < 10 minutes
▸ Significantly improved page load times
▸ Improved audience stats (time on page, pages per session,
session duration, traffic, seo ranking, etc)
▸ Increased confidence and velocity
▸ Experimented with new tech/stacks (angular, jvm, event
sourcing)
▸ More fun
LESSONS LEARNED
▸ Team acceptance
▸ Change is hard
▸ Overhead of weekly sprint; requires discipline
▸ Docker orchestration
▸ Issues with traffic between Amazon <-> on-premise
datacenter
▸ Javascript testing
LESSONS LEARNED
▸ Experience with new tech
▸ Stability of build pipelines
▸ Management/leadership buy-in
▸ Business alignment
▸ Not enough focus on replacing legacy application
THANK YOU!
@michieltcs / michiel@make.io

More Related Content

What's hot (20)

KEY
groovy & grails - lecture 5
Alexandre Masselot
 
PPTX
Practical approach for testing your software with php unit
Mario Bittencourt
 
PDF
Unit Testing for Great Justice
Domenic Denicola
 
PDF
PHP traits, treat or threat?
Nick Belhomme
 
PPTX
Xenogenetics for PL/SQL - infusing with Java best practices
Lucas Jellema
 
ODP
Mastering Namespaces in PHP
Nick Belhomme
 
PDF
WordPress Development in a Modern PHP World
DrewAPicture
 
PPTX
A new way to develop with WordPress!
David Sanchez
 
PDF
Your code are my tests
Michelangelo van Dam
 
KEY
Zend Framework Study@Tokyo #2
Shinya Ohyanagi
 
PDF
Workshop quality assurance for php projects - ZendCon 2013
Michelangelo van Dam
 
PDF
The new features of PHP 7
Zend by Rogue Wave Software
 
PDF
Api Design
sumithra jonnalagadda
 
PDF
UA testing with Selenium and PHPUnit - PFCongres 2013
Michelangelo van Dam
 
PDF
Perl web frameworks
diego_k
 
KEY
groovy & grails - lecture 6
Alexandre Masselot
 
PPTX
PHP7 Presentation
David Sanchez
 
PDF
Continuous Quality Assurance
Michelangelo van Dam
 
PDF
Asynchronous I/O in PHP
Thomas Weinert
 
PDF
Debugging PHP with Xdebug - PHPUK 2018
Mark Niebergall
 
groovy & grails - lecture 5
Alexandre Masselot
 
Practical approach for testing your software with php unit
Mario Bittencourt
 
Unit Testing for Great Justice
Domenic Denicola
 
PHP traits, treat or threat?
Nick Belhomme
 
Xenogenetics for PL/SQL - infusing with Java best practices
Lucas Jellema
 
Mastering Namespaces in PHP
Nick Belhomme
 
WordPress Development in a Modern PHP World
DrewAPicture
 
A new way to develop with WordPress!
David Sanchez
 
Your code are my tests
Michelangelo van Dam
 
Zend Framework Study@Tokyo #2
Shinya Ohyanagi
 
Workshop quality assurance for php projects - ZendCon 2013
Michelangelo van Dam
 
The new features of PHP 7
Zend by Rogue Wave Software
 
UA testing with Selenium and PHPUnit - PFCongres 2013
Michelangelo van Dam
 
Perl web frameworks
diego_k
 
groovy & grails - lecture 6
Alexandre Masselot
 
PHP7 Presentation
David Sanchez
 
Continuous Quality Assurance
Michelangelo van Dam
 
Asynchronous I/O in PHP
Thomas Weinert
 
Debugging PHP with Xdebug - PHPUK 2018
Mark Niebergall
 

Similar to The road to continuous deployment (DomCode September 2016) (20)

PDF
The Road to Continuous Deployment
Sonatype
 
PDF
The road to continuous deployment: a case study (DPC16)
Michiel Rook
 
PDF
The Road to Continuous Deployment: a case study by Michiel Rook
Bosnia Agile
 
PDF
The road to continuous deployment: a case study - Michiel Rook - Codemotion A...
Codemotion
 
PDF
Continuous Deployment: Beyond Continuous Delivery
Timothy Fitz
 
PDF
From dev to ops and beyond - getting it done
Edorian
 
PPTX
Anatomy of a Build Pipeline
Samuel Brown
 
PDF
Developing PHP Applications Faster
Adam Culp
 
PDF
Continuous Delivery at Snyk
Anton Drukh
 
PPTX
Operations Support Workflow - Rundeck
Neil McCaughley
 
PPTX
Continuous Delivery Applied
DC Agile Engineering Conference
 
PPTX
Continuous Delivery Applied (Agile Richmond)
Mike McGarr
 
PPTX
Continuous Delivery Applied
Excella
 
PDF
PouyaKarimiv12
Pouya Karimi
 
PPTX
Continuous Delivery - Automate & Build Better Software with Travis CI
wajrcs
 
PPTX
Road to Continuous Delivery - Wix.com
Aviran Mordo
 
PDF
TYPO3 Camp Stuttgart 2015 - Continuous Delivery with Open Source Tools
Michael Lihs
 
PPTX
Linuxtag 2012 - continuous delivery - dream to reality
Clément Escoffier
 
PPTX
Developing apps faster
Zend by Rogue Wave Software
 
PPTX
Sv jug - mar 2013 - sl
CloudBees
 
The Road to Continuous Deployment
Sonatype
 
The road to continuous deployment: a case study (DPC16)
Michiel Rook
 
The Road to Continuous Deployment: a case study by Michiel Rook
Bosnia Agile
 
The road to continuous deployment: a case study - Michiel Rook - Codemotion A...
Codemotion
 
Continuous Deployment: Beyond Continuous Delivery
Timothy Fitz
 
From dev to ops and beyond - getting it done
Edorian
 
Anatomy of a Build Pipeline
Samuel Brown
 
Developing PHP Applications Faster
Adam Culp
 
Continuous Delivery at Snyk
Anton Drukh
 
Operations Support Workflow - Rundeck
Neil McCaughley
 
Continuous Delivery Applied
DC Agile Engineering Conference
 
Continuous Delivery Applied (Agile Richmond)
Mike McGarr
 
Continuous Delivery Applied
Excella
 
PouyaKarimiv12
Pouya Karimi
 
Continuous Delivery - Automate & Build Better Software with Travis CI
wajrcs
 
Road to Continuous Delivery - Wix.com
Aviran Mordo
 
TYPO3 Camp Stuttgart 2015 - Continuous Delivery with Open Source Tools
Michael Lihs
 
Linuxtag 2012 - continuous delivery - dream to reality
Clément Escoffier
 
Developing apps faster
Zend by Rogue Wave Software
 
Sv jug - mar 2013 - sl
CloudBees
 
Ad

More from Michiel Rook (6)

PDF
CQRS & Event Sourcing in the wild (ScotlandPHP 2016)
Michiel Rook
 
PDF
CQRS & event sourcing in the wild
Michiel Rook
 
PDF
Building and Deploying PHP apps with Phing
Michiel Rook
 
PDF
Building and deploying PHP applications with Phing
Michiel Rook
 
PDF
Deploying PHP applications with Phing
Michiel Rook
 
ODP
Phing - A PHP Build Tool (An Introduction)
Michiel Rook
 
CQRS & Event Sourcing in the wild (ScotlandPHP 2016)
Michiel Rook
 
CQRS & event sourcing in the wild
Michiel Rook
 
Building and Deploying PHP apps with Phing
Michiel Rook
 
Building and deploying PHP applications with Phing
Michiel Rook
 
Deploying PHP applications with Phing
Michiel Rook
 
Phing - A PHP Build Tool (An Introduction)
Michiel Rook
 
Ad

Recently uploaded (20)

PPT
Activate_Methodology_Summary presentatio
annapureddyn
 
PDF
Enhancing Healthcare RPM Platforms with Contextual AI Integration
Cadabra Studio
 
PDF
Generating Union types w/ Static Analysis
K. Matthew Dupree
 
PDF
How to Download and Install ADT (ABAP Development Tools) for Eclipse IDE | SA...
SAP Vista, an A L T Z E N Company
 
PDF
Summary Of Odoo 18.1 to 18.4 : The Way For Odoo 19
CandidRoot Solutions Private Limited
 
PPTX
Explanation about Structures in C language.pptx
Veeral Rathod
 
PDF
How Agentic AI Networks are Revolutionizing Collaborative AI Ecosystems in 2025
ronakdubey419
 
PPTX
slidesgo-unlocking-the-code-the-dynamic-dance-of-variables-and-constants-2024...
kr2589474
 
PPT
Why Reliable Server Maintenance Service in New York is Crucial for Your Business
Sam Vohra
 
PDF
Why Are More Businesses Choosing Partners Over Freelancers for Salesforce.pdf
Cymetrix Software
 
PDF
New Download FL Studio Crack Full Version [Latest 2025]
imang66g
 
PDF
WatchTraderHub - Watch Dealer software with inventory management and multi-ch...
WatchDealer Pavel
 
PPTX
Web Testing.pptx528278vshbuqffqhhqiwnwuq
studylike474
 
PPTX
GALILEO CRS SYSTEM | GALILEO TRAVEL SOFTWARE
philipnathen82
 
PDF
Salesforce Implementation Services Provider.pdf
VALiNTRY360
 
PDF
Using licensed Data Loss Prevention (DLP) as a strategic proactive data secur...
Q-Advise
 
PPTX
ASSIGNMENT_1[1][1][1][1][1] (1) variables.pptx
kr2589474
 
PDF
SAP GUI Installation Guide for Windows | Step-by-Step Setup for SAP Access
SAP Vista, an A L T Z E N Company
 
PPTX
TRAVEL APIs | WHITE LABEL TRAVEL API | TOP TRAVEL APIs
philipnathen82
 
PDF
AI Image Enhancer: Revolutionizing Visual Quality”
docmasoom
 
Activate_Methodology_Summary presentatio
annapureddyn
 
Enhancing Healthcare RPM Platforms with Contextual AI Integration
Cadabra Studio
 
Generating Union types w/ Static Analysis
K. Matthew Dupree
 
How to Download and Install ADT (ABAP Development Tools) for Eclipse IDE | SA...
SAP Vista, an A L T Z E N Company
 
Summary Of Odoo 18.1 to 18.4 : The Way For Odoo 19
CandidRoot Solutions Private Limited
 
Explanation about Structures in C language.pptx
Veeral Rathod
 
How Agentic AI Networks are Revolutionizing Collaborative AI Ecosystems in 2025
ronakdubey419
 
slidesgo-unlocking-the-code-the-dynamic-dance-of-variables-and-constants-2024...
kr2589474
 
Why Reliable Server Maintenance Service in New York is Crucial for Your Business
Sam Vohra
 
Why Are More Businesses Choosing Partners Over Freelancers for Salesforce.pdf
Cymetrix Software
 
New Download FL Studio Crack Full Version [Latest 2025]
imang66g
 
WatchTraderHub - Watch Dealer software with inventory management and multi-ch...
WatchDealer Pavel
 
Web Testing.pptx528278vshbuqffqhhqiwnwuq
studylike474
 
GALILEO CRS SYSTEM | GALILEO TRAVEL SOFTWARE
philipnathen82
 
Salesforce Implementation Services Provider.pdf
VALiNTRY360
 
Using licensed Data Loss Prevention (DLP) as a strategic proactive data secur...
Q-Advise
 
ASSIGNMENT_1[1][1][1][1][1] (1) variables.pptx
kr2589474
 
SAP GUI Installation Guide for Windows | Step-by-Step Setup for SAP Access
SAP Vista, an A L T Z E N Company
 
TRAVEL APIs | WHITE LABEL TRAVEL API | TOP TRAVEL APIs
philipnathen82
 
AI Image Enhancer: Revolutionizing Visual Quality”
docmasoom
 

The road to continuous deployment (DomCode September 2016)

  • 1. THE ROAD TO CONTINUOUS DEPLOYMENT - A CASE STUDY MICHIEL ROOK
  • 2. ▸ Java, PHP & Scala developer ▸ Consultant, trainer, speaker ▸ make.io ▸ Dutch Web Alliance ▸ Maintainer of Phing ▸ @michieltcs
  • 3. THIS TALK ▸ Background ▸ The approach ▸ Process / standards ▸ Build pipelines ▸ Results & lessons learned
  • 5. THE SYSTEM - SAN DIEGO ▸ ... or the Big Ball Of Mud ▸ Large legacy monolith ▸ Generates significant income ▸ Slow & complex ▸ Technical debt
  • 6. SAN DIEGO FRONTEND MYSQL DB SAN DIEGO BACKEND LOAD BALANCERS / VARNISH ITBANEN INTERMEDIAIR NATIONALEVACATUREBANK SAN DIEGO FRONTEND SAN DIEGO FRONTEND SAN DIEGO FRONTEND SAN DIEGO BACKEND SAN DIEGO BACKEND SAN DIEGO BACKEND MEMCACHE FTP EXT. SERVICES SOLR
  • 7. THE SYSTEM - SAN DIEGO ▸ Infrequent, manual releases ▸ Fragile tests ▸ Low velocity ▸ Frequent outages / bugs / issues ▸ Frustrated team ▸ Low confidence modifying existing code
  • 8. GOALS ▸ Reduce issues ▸ Reduce cycle time ▸ Increase productivity ▸ Increase motivation
  • 10. APPROACH ▸ Services per domain object (job, jobseeker, ...) ▸ Strangler pattern ▸ Proxy to switch between old/new ▸ Migrate individual pages
  • 12. APPROACH ▸ Services behind load balancers ▸ Access legacy db’s ▸ Continuous deployment ▸ Docker containers ▸ Frontends are services
  • 13. SAN DIEGO ELASTIC SEARCHLEGACY DB JOB SERVICE RMQ ITBANEN INTERMEDIAIR NATIONALEVACATUREBANK MONGO DB ITBANEN JOBSEEKER SERVICE NVBINTERMEDIAI
  • 15. STARTING OFF ▸ Scrum, 1 week sprints ▸ TDD / BDD ▸ Definition of Done ▸ Team mindset / experience ▸ Focus on value ▸ Replace old features with new (legacy becomes obsolete)
  • 17. DEV BUILD / TEST CONTINUOUS INTEGRATION
  • 18. DEV BUILD / TEST ACCEPTANCE PRODUCTION CONTINUOUS DELIVERY
  • 19. DEV BUILD / TEST ACCEPTANCE PRODUCTION CONTINUOUS DEPLOYMENT
  • 20. WHY CONTINUOUS DEPLOYMENT ▸ Small steps ▸ Early feedback ▸ Less overhead ▸ Reduce cycle time ▸ Reduce risk
  • 21. ONLY COMMIT TO MASTER
  • 32. EVERY COMMIT GOES TO PRODUCTION
  • 33. DEFENSE IN DEPTH UNIT TESTS INTEGRATION
 TESTS ACCEPTANCE
 TESTS UI TESTS
  • 34. DEFENSE IN DEPTH UNIT TESTS INTEGRATION
 TESTS ACCEPTANCE UI TESTS public function testJobCannotBeFound() {
 $jobRepository = $this->prophesize(JobRepository::class);
 $jobRepository->getById(EXPECTED_JOB_ID)
 ->shouldBeCalled()
 ->willReturn(false);
 
 $jobService = new JobService($jobRepository->reveal());
 
 $this->assertFalse($jobService->getById(EXPECTED_JOB_ID));
 }
  • 35. DEFENSE IN DEPTH UNIT TESTS INTEGRATION
 TESTS ACCEPTANCE
 TESTS UI TESTS public function testFindJob() {
 $expectedJob = $this->loadFixture('active_job.yml');
 $actualJob = $this->repository->getById($expectedJob->getId());
 
 self::assertInstanceOf(Job::class, $actualJob);
 self::assertEquals($expectedJob->getId(), $actualJob->getId());
 }
  • 36. DEFENSE IN DEPTH UNIT TESTS INTEGRATION
 TESTS ACCEPTANCE
 TESTS UI TESTSScenario: Link to related job
 Given a job exists
 And there are related jobs available
 When that job is viewed
 Then a list of related jobs is shown
 And each related job links to the detail page of the related job
  • 37. DEFENSE IN DEPTH UNIT TESTS INTEGRATION
 TESTS ACCEPTANCE
 TESTS UI TESTS
  • 38. DEFENSE IN DEPTH MANUAL TESTING? UNIT TESTS INTEGRATION
 TESTS ACCEPTANCE
 TESTS UI
  • 39. CONTINUOUS TESTING UNIT TESTS INTEGRATION TESTS ACCEPTANCE TESTS UI TESTS SMOKE
 TESTS Cost Speed Exploratory
 testing Monitoring
  • 40. DEPLOYING PULL IMAGE START NEW CONTAINER WAIT FOR PORT SMOKE TESTS / HEALTH CHECKS ADD NEW CONTAINER TO LB REMOVE OLD CONTAINER FROM LB STOP OLD CONTAINER
  • 41. DEPLOYING PULL IMAGE START NEW CONTAINER WAIT FOR PORT SMOKE TESTS / HEALTH CHECKS ADD NEW CONTAINER TO LB REMOVE OLD CONTAINER FROM LB STOP OLD CONTAINER docker pull
  • 42. DEPLOYING PULL IMAGE START NEW CONTAINER WAIT FOR PORT SMOKE TESTS / HEALTH CHECKS ADD NEW CONTAINER TO LB REMOVE OLD CONTAINER FROM LB STOP OLD CONTAINER docker run
  • 43. DEPLOYING PULL IMAGE START NEW CONTAINER WAIT FOR PORT SMOKE TESTS / HEALTH CHECKS ADD NEW CONTAINER TO LB REMOVE OLD CONTAINER FROM LB STOP OLD CONTAINER wait_for: port=8080 delay=5 timeout=15
  • 44. DEPLOYING PULL IMAGE START NEW CONTAINER WAIT FOR PORT SMOKE TESTS / HEALTH CHECKS ADD NEW CONTAINER TO LB REMOVE OLD CONTAINER FROM LB STOP OLD CONTAINER uri:
 url: http://localhost:8080/_health
 status_code: 200
 timeout: 30
  • 45. DEPLOYING PULL IMAGE START NEW CONTAINER WAIT FOR PORT SMOKE TESTS / HEALTH CHECKS ADD NEW CONTAINER TO LB REMOVE OLD CONTAINER FROM LB STOP OLD CONTAINER template: src=haproxy.cfg.j2
 dest=/etc/haproxy/haproxy.cfg service: name=haproxy state=reloaded
  • 46. DEPLOYING PULL IMAGE START NEW CONTAINER WAIT FOR PORT SMOKE TESTS / HEALTH CHECKS ADD NEW CONTAINER TO LB REMOVE OLD CONTAINER FROM LB STOP OLD CONTAINER template: src=haproxy.cfg.j2
 dest=/etc/haproxy/haproxy.cfg service: name=haproxy state=reloaded
  • 47. DEPLOYING PULL IMAGE START NEW CONTAINER WAIT FOR PORT SMOKE TESTS / HEALTH CHECKS ADD NEW CONTAINER TO LB REMOVE OLD CONTAINER FROM LB STOP OLD CONTAINER docker stop docker rm
  • 48. PIPELINE AS CODE node {
 stage 'Run tests'
 sh "phpunit"
 sh "behat"
 
 stage 'Build docker image'
 sh "phing build"
 sh "docker build -t jobservice:${env.BUILD_NUMBER} ."
 sh "docker push jobservice:${env.BUILD_NUMBER}"
 
 stage 'Deploy acceptance'
 sh "ansible-playbook -e BUILD_NUMBER=${env.BUILD_NUMBER} -i acc deploy.yml"
 
 stage 'Deploy production'
 sh "ansible-playbook -e BUILD_NUMBER=${env.BUILD_NUMBER} -i prod deploy.yml"
 }
  • 52. RESULTS ▸ Total build time per service < 10 minutes ▸ Significantly improved page load times ▸ Improved audience stats (time on page, pages per session, session duration, traffic, seo ranking, etc) ▸ Increased confidence and velocity ▸ Experimented with new tech/stacks (angular, jvm, event sourcing) ▸ More fun
  • 53. LESSONS LEARNED ▸ Team acceptance ▸ Change is hard ▸ Overhead of weekly sprint; requires discipline ▸ Docker orchestration ▸ Issues with traffic between Amazon <-> on-premise datacenter ▸ Javascript testing
  • 54. LESSONS LEARNED ▸ Experience with new tech ▸ Stability of build pipelines ▸ Management/leadership buy-in ▸ Business alignment ▸ Not enough focus on replacing legacy application