buy it, use it, break it, fix it continuous integration · • continuous integration is about...
TRANSCRIPT
![Page 1: BUY IT, USE IT, BREAK IT, FIX IT CONTINUOUS INTEGRATION · • Continuous integration is about communication. ... • Consider an automated rollback. BUILD SERVERS • Tools that](https://reader034.vdocuments.mx/reader034/viewer/2022043022/5f3ddb19e919ba26a14a94b1/html5/thumbnails/1.jpg)
BUY IT, USE IT, BREAK IT, FIX IT
CONTINUOUS INTEGRATION
SAMUEL PETOVSKY
![Page 2: BUY IT, USE IT, BREAK IT, FIX IT CONTINUOUS INTEGRATION · • Continuous integration is about communication. ... • Consider an automated rollback. BUILD SERVERS • Tools that](https://reader034.vdocuments.mx/reader034/viewer/2022043022/5f3ddb19e919ba26a14a94b1/html5/thumbnails/2.jpg)
OUTLINE
• Introduction• Overview• Motivation• Best Practices• Build Servers• Real Life Example
![Page 3: BUY IT, USE IT, BREAK IT, FIX IT CONTINUOUS INTEGRATION · • Continuous integration is about communication. ... • Consider an automated rollback. BUILD SERVERS • Tools that](https://reader034.vdocuments.mx/reader034/viewer/2022043022/5f3ddb19e919ba26a14a94b1/html5/thumbnails/3.jpg)
INTRODUCTION
• Software development practice where members of a team integrate their work as often as possible, usually several times a day to prevent„integration hell“
• Build automation
• Often combined with automated testing
![Page 4: BUY IT, USE IT, BREAK IT, FIX IT CONTINUOUS INTEGRATION · • Continuous integration is about communication. ... • Consider an automated rollback. BUILD SERVERS • Tools that](https://reader034.vdocuments.mx/reader034/viewer/2022043022/5f3ddb19e919ba26a14a94b1/html5/thumbnails/4.jpg)
INTRODUCTION
• Feature toggle instead of branches
• Continuous delivery
• Build servers
![Page 5: BUY IT, USE IT, BREAK IT, FIX IT CONTINUOUS INTEGRATION · • Continuous integration is about communication. ... • Consider an automated rollback. BUILD SERVERS • Tools that](https://reader034.vdocuments.mx/reader034/viewer/2022043022/5f3ddb19e919ba26a14a94b1/html5/thumbnails/5.jpg)
OVERVIEW
• Commit it
• Build it
• Test it
• Fix it (if broken)
![Page 6: BUY IT, USE IT, BREAK IT, FIX IT CONTINUOUS INTEGRATION · • Continuous integration is about communication. ... • Consider an automated rollback. BUILD SERVERS • Tools that](https://reader034.vdocuments.mx/reader034/viewer/2022043022/5f3ddb19e919ba26a14a94b1/html5/thumbnails/6.jpg)
MOTIVATION
• Switch to continuous deployment has been linked to very concrete and visible financial success (Linkedin)
• Facebook releases to production twice a day
• Amazon makes changes to production every 11.6 seconds
• 8 minutes after you commit code it's live in production (Google Consumer Surveys)
![Page 7: BUY IT, USE IT, BREAK IT, FIX IT CONTINUOUS INTEGRATION · • Continuous integration is about communication. ... • Consider an automated rollback. BUILD SERVERS • Tools that](https://reader034.vdocuments.mx/reader034/viewer/2022043022/5f3ddb19e919ba26a14a94b1/html5/thumbnails/7.jpg)
BEST PRACTICES
1. Maintain a Single Source Repository
• Use Source code management tools (SVN, Git, Mercurial)
• Put all project-related files into repository
![Page 8: BUY IT, USE IT, BREAK IT, FIX IT CONTINUOUS INTEGRATION · • Continuous integration is about communication. ... • Consider an automated rollback. BUILD SERVERS • Tools that](https://reader034.vdocuments.mx/reader034/viewer/2022043022/5f3ddb19e919ba26a14a94b1/html5/thumbnails/8.jpg)
2. Automate the Build
• Involve everything in the build (running pre-installation scripts, loading database schema, compiling…)
• Ant, MSBuild, Make• Build servers
BEST PRACTICES
![Page 9: BUY IT, USE IT, BREAK IT, FIX IT CONTINUOUS INTEGRATION · • Continuous integration is about communication. ... • Consider an automated rollback. BUILD SERVERS • Tools that](https://reader034.vdocuments.mx/reader034/viewer/2022043022/5f3ddb19e919ba26a14a94b1/html5/thumbnails/9.jpg)
3. Make the Build Self-Testing
• Produce self-testing code• xUnit tests, Selenium…
BEST PRACTICES
![Page 10: BUY IT, USE IT, BREAK IT, FIX IT CONTINUOUS INTEGRATION · • Continuous integration is about communication. ... • Consider an automated rollback. BUILD SERVERS • Tools that](https://reader034.vdocuments.mx/reader034/viewer/2022043022/5f3ddb19e919ba26a14a94b1/html5/thumbnails/10.jpg)
4. Everyone Commits To the Mainline Every Day
• Break the work into small chunks• It prevents „Integration Hell“• Issues and conflicts are detected sooner and
thus easier to fix
BEST PRACTICES
![Page 11: BUY IT, USE IT, BREAK IT, FIX IT CONTINUOUS INTEGRATION · • Continuous integration is about communication. ... • Consider an automated rollback. BUILD SERVERS • Tools that](https://reader034.vdocuments.mx/reader034/viewer/2022043022/5f3ddb19e919ba26a14a94b1/html5/thumbnails/11.jpg)
5. Every Commit Should Build the Mainline on an Integration Machine
• No branches• Commit build
BEST PRACTICES
![Page 12: BUY IT, USE IT, BREAK IT, FIX IT CONTINUOUS INTEGRATION · • Continuous integration is about communication. ... • Consider an automated rollback. BUILD SERVERS • Tools that](https://reader034.vdocuments.mx/reader034/viewer/2022043022/5f3ddb19e919ba26a14a94b1/html5/thumbnails/12.jpg)
6. Fix Broken Builds Immediately
• Fixing the broken build has a highest priority• Revert to latest stable state
BEST PRACTICES
![Page 13: BUY IT, USE IT, BREAK IT, FIX IT CONTINUOUS INTEGRATION · • Continuous integration is about communication. ... • Consider an automated rollback. BUILD SERVERS • Tools that](https://reader034.vdocuments.mx/reader034/viewer/2022043022/5f3ddb19e919ba26a14a94b1/html5/thumbnails/13.jpg)
7. Keep the Build Fast
• Do not include everything in the commit builds• Use parallelization• Put more time-consuming tasks into nightly
builds instead (static code analysis…)
BEST PRACTICES
![Page 14: BUY IT, USE IT, BREAK IT, FIX IT CONTINUOUS INTEGRATION · • Continuous integration is about communication. ... • Consider an automated rollback. BUILD SERVERS • Tools that](https://reader034.vdocuments.mx/reader034/viewer/2022043022/5f3ddb19e919ba26a14a94b1/html5/thumbnails/14.jpg)
8. Test in a Clone of the Production Environment
• The difference between test and production environments can cause troubles.
• Use the same hardware, operating system, database, firewall settings, test on the real data.
BEST PRACTICES
![Page 15: BUY IT, USE IT, BREAK IT, FIX IT CONTINUOUS INTEGRATION · • Continuous integration is about communication. ... • Consider an automated rollback. BUILD SERVERS • Tools that](https://reader034.vdocuments.mx/reader034/viewer/2022043022/5f3ddb19e919ba26a14a94b1/html5/thumbnails/15.jpg)
9. Make it Easy for Anyone to Get the Latest Executable
• To help make this work, anyone involved with a software project should be able to get the latest executable and be able to run it
BEST PRACTICES
![Page 16: BUY IT, USE IT, BREAK IT, FIX IT CONTINUOUS INTEGRATION · • Continuous integration is about communication. ... • Consider an automated rollback. BUILD SERVERS • Tools that](https://reader034.vdocuments.mx/reader034/viewer/2022043022/5f3ddb19e919ba26a14a94b1/html5/thumbnails/16.jpg)
10. Everyone can see what's happening
• Continuous integration is about communication.• Everyone should know the state of the mainline
build.
BEST PRACTICES
![Page 17: BUY IT, USE IT, BREAK IT, FIX IT CONTINUOUS INTEGRATION · • Continuous integration is about communication. ... • Consider an automated rollback. BUILD SERVERS • Tools that](https://reader034.vdocuments.mx/reader034/viewer/2022043022/5f3ddb19e919ba26a14a94b1/html5/thumbnails/17.jpg)
12. Automate Deployment
• CI makes deployment boring.• Consider an automated rollback.
BUILD SERVERS
![Page 18: BUY IT, USE IT, BREAK IT, FIX IT CONTINUOUS INTEGRATION · • Continuous integration is about communication. ... • Consider an automated rollback. BUILD SERVERS • Tools that](https://reader034.vdocuments.mx/reader034/viewer/2022043022/5f3ddb19e919ba26a14a94b1/html5/thumbnails/18.jpg)
• Tools that help with CI• Build and deployment automation• Advanced setting of CI cycle (pre and post-build
steps, build stages, task parallelization)• Often offer scalability• Bamboo, Jenkins, Travis
BEST PRACTICES
![Page 19: BUY IT, USE IT, BREAK IT, FIX IT CONTINUOUS INTEGRATION · • Continuous integration is about communication. ... • Consider an automated rollback. BUILD SERVERS • Tools that](https://reader034.vdocuments.mx/reader034/viewer/2022043022/5f3ddb19e919ba26a14a94b1/html5/thumbnails/19.jpg)
REAL LIFE EXAMPLE
![Page 20: BUY IT, USE IT, BREAK IT, FIX IT CONTINUOUS INTEGRATION · • Continuous integration is about communication. ... • Consider an automated rollback. BUILD SERVERS • Tools that](https://reader034.vdocuments.mx/reader034/viewer/2022043022/5f3ddb19e919ba26a14a94b1/html5/thumbnails/20.jpg)
Q&A
SAMUEL PETOVSKY