Upload
others
View
9
Download
0
Embed Size (px)
Citation preview
Continuous Delivery
from Zero to Hero
AXEL FONTAINE@axelfontaine
axelfontaine.com
Entrepreneur - Public Speaker - Continuous Delivery Expert
AXEL FONTAINE@axelfontaine
axelfontaine.com
Entrepreneur - Public Speaker - Continuous Delivery Expert
flywaydb.org getphoton.com
photon
about
questions
GOAL
Fully automated deploymentof a complete application
into productionmultiple times a daywith zero downtime
Puttingthingsinto
PERSPECTIVE
http://digitalcitizen.ca/2009/06/22/simpsons-profile-pics-for-facebook-and-other-applications/
CONTINUOUS
DELIVERY
http://www.flickr.com/photos/kamshots/3096111340/
stackoverflow.com
stackoverflow.com
stackoverflow.com
stackoverflow.com
Prerequisites
Processhttp://www.flickr.com/photos/feffef/460299390/in/photostream/
Processhttp://www.flickr.com/photos/feffef/460299390/in/photostream/
Build
Build
Version Control
Version Control
Testhttp://www.flickr.com/photos/vitorcastillo/2994723741/
Testhttp://www.flickr.com/photos/vitorcastillo/2994723741/
Unit Test Component Test Acceptance Test
Small Medium Large
Unit Test Component Test Acceptance Test
Small Medium Large
Build
DEV
SmallTests
Build
DEV
SmallTests
MediumTests
Build
DEV
SmallTests
MediumTests
LargeTests
VersionControl
Build Build
DEV ContinuousIntegration
SmallTests
MediumTests
LargeTests
SmallTests
MediumTests
LargeTests
hands-on
VirtualBox 10.0.2.2:xxxx
CI
Jenkins :8080 -> :8080
Artifactory :8081 -> :8081
LBHAProxy :9000 -> :9000
APP2Jetty :9100 -> :9102
SSH :22 -> :9112
APP1Jetty :9100 -> :9101
SSH :22 -> :9111 DBH2 :9200 -> :9200
DEPLOYMENTautomation
http://www.flickr.com/photos/soldiersmediacenter/3650607959/
do
NOT
deploy
SNAPSHOTS !
VersionControl
Build Build Release
DEV Continuous Integration
SmallTests
MediumTests
LargeTests
SmallTests
MediumTests
LargeTests
Artifact Repository
hands-on
DB DeltaCode Configuration
What gets deployed?
Code
DeploymentPackage
Code
DeploymentPackage
DeploymentScript
backupstopinstallstart…
Code
DeploymentPackage
DeploymentScript
backupstopinstallstart…
Release
Continuous Integration
Artifact Repository
Target
DeploymentScript
backupstopinstallstart…
hands-on
Configuration
DeploymentPackage
Code
Maybe it could change one day ≠ Environments
Code
DeploymentPackage
?Environment Detection
Code
Auto-Configuration
TestEnvironment
Detection
Release
Continuous Integration
Artifact Repository
Target
DeploymentScript
backupstopinstallstart…
hands-on
DB
DB
DB
DB
Zero DowntimeRolling Updates
hands-on
DB Delta
The Fearof
DDL
DEV PROD
?
VS
DML DDLhttp://digitalcitizen.ca/2009/06/22/simpsons-profile-pics-for-facebook-and-other-applications/
Name Balance
Homer 163
Marge 214
Bart 9
Lisa 25
VS
DML DDL
Name Balance
Homer 0
Marge 0
Bart 0
Lisa 0
Name
Homer
Marge
Bart
Lisa
VS
DML DDL
DB Delta
Code
DeploymentPackage
Code
DeploymentPackage
DB?
?
flywaydb.org
How doesFlyway work?
Empty DB
Empty DB
Empty DB Version 1
Empty DB Version 1 Version 2
Release
Continuous Integration
Artifact Repository
Target
DeploymentScript
backupstopinstallstart…
hands-on
Backwards-compatiblemigrations
Surname Last_Name
ALTER TABLE … RENAME COLUMN
Surname
Last_Name Last_Name
Last_NameSurname
ALTER TABLE …ADD COLUMN Last_Name
UPDATE … SET Last_Name = SurnameCREATE TRIGGER …
DROP TRIGGER …ALTER TABLE …
DROP COLUMN Surname
Last_Name
Last_Name
DROP TRIGGER …ALTER TABLE …
DROP COLUMN Surname
hands-on
Registration
MailService
Registration
MailService
Registrationv2
MailService
ParcelService
Registration
MailService
Feature TogglesBranch by Abstraction
ParcelService
Registration
MailService
ParcelService
Feature TogglesBranch by Abstraction
hands-on
Summary
VersionControl
Build Build Release
DEV Continuous Integration
SmallTests
MediumTests
LargeTests
SmallTests
MediumTests
LargeTests
Artifact Repository
Target
DeploymentScript
backupstopinstallstart…
http://de.wikipedia.org/wiki/Datei:Yemen_Chameleon.jpg
One more thing
http://axelfontaine.com/blog/final-nail.html
http://axelfontaine.com/blog/environment-detection.html
http://martinfowler.com/bliki/FeatureToggle.html
http://googletesting.blogspot.com/2010/12/test-sizes.html
http://blog.shinetech.com/2012/12/18/simple-session-sharing-in-tomcat-cluster-using-the-session-in-cookie-pattern/