ruby ci with jenkins
DESCRIPTION
In this short talk, Ishow some great ways you can use Jenkins to supercharge both the development AND deployment of your Ruby projects. Finally, I will demonstrate how you can extend the Jenkins CI server (which is written in Java) with nothing Ruby code.If you aren't getting the most out of your CI tools, or you aren't using a CI tool at all, then this is for you! Implementing a proper CI is a game changer to the way you and your team develop software.TRANSCRIPT
![Page 1: Ruby CI with Jenkins](https://reader034.vdocuments.us/reader034/viewer/2022051012/54639996af795983338b45aa/html5/thumbnails/1.jpg)
• cowboyd@github
• cowboyd@twitter
Ruby CI with Jenkins
1Monday, March 5, 2012
![Page 2: Ruby CI with Jenkins](https://reader034.vdocuments.us/reader034/viewer/2022051012/54639996af795983338b45aa/html5/thumbnails/2.jpg)
Your Development Process Needs CI
2Monday, March 5, 2012
![Page 3: Ruby CI with Jenkins](https://reader034.vdocuments.us/reader034/viewer/2022051012/54639996af795983338b45aa/html5/thumbnails/3.jpg)
Not for code quality*
* this is still very important3Monday, March 5, 2012
![Page 4: Ruby CI with Jenkins](https://reader034.vdocuments.us/reader034/viewer/2022051012/54639996af795983338b45aa/html5/thumbnails/4.jpg)
For deployment
4Monday, March 5, 2012
![Page 5: Ruby CI with Jenkins](https://reader034.vdocuments.us/reader034/viewer/2022051012/54639996af795983338b45aa/html5/thumbnails/5.jpg)
You Need CI.CI is crucial to
application distribution
5Monday, March 5, 2012
![Page 6: Ruby CI with Jenkins](https://reader034.vdocuments.us/reader034/viewer/2022051012/54639996af795983338b45aa/html5/thumbnails/6.jpg)
Ruby deploys suck
6Monday, March 5, 2012
![Page 7: Ruby CI with Jenkins](https://reader034.vdocuments.us/reader034/viewer/2022051012/54639996af795983338b45aa/html5/thumbnails/7.jpg)
Typical Deploy
• check out from source control
• bundle gems
• generate assets (rails/sprockets)
• and then more stuff...
7Monday, March 5, 2012
![Page 8: Ruby CI with Jenkins](https://reader034.vdocuments.us/reader034/viewer/2022051012/54639996af795983338b45aa/html5/thumbnails/8.jpg)
Deploying from SCM sucks
8Monday, March 5, 2012
![Page 9: Ruby CI with Jenkins](https://reader034.vdocuments.us/reader034/viewer/2022051012/54639996af795983338b45aa/html5/thumbnails/9.jpg)
Deploying from SCM sucks
• If Github is getting DDOS’d should that mean you can’t deploy?
• Branches and tags can be moving targets
• server affinity for a particular branch
9Monday, March 5, 2012
![Page 10: Ruby CI with Jenkins](https://reader034.vdocuments.us/reader034/viewer/2022051012/54639996af795983338b45aa/html5/thumbnails/10.jpg)
Bundling gems at deploy-time sucks
10Monday, March 5, 2012
![Page 11: Ruby CI with Jenkins](https://reader034.vdocuments.us/reader034/viewer/2022051012/54639996af795983338b45aa/html5/thumbnails/11.jpg)
Bundling gems at deploy-time sucks
• Why should my deploy depend on rubygems.org?
• My app is about to go live. Is now really the best time to be compiling C extensions?
11Monday, March 5, 2012
![Page 12: Ruby CI with Jenkins](https://reader034.vdocuments.us/reader034/viewer/2022051012/54639996af795983338b45aa/html5/thumbnails/12.jpg)
Asset generation on deploy sucks
12Monday, March 5, 2012
![Page 13: Ruby CI with Jenkins](https://reader034.vdocuments.us/reader034/viewer/2022051012/54639996af795983338b45aa/html5/thumbnails/13.jpg)
Asset generation on deploy sucks
• time consuming
• not tested anywhere else until go-time
13Monday, March 5, 2012
![Page 14: Ruby CI with Jenkins](https://reader034.vdocuments.us/reader034/viewer/2022051012/54639996af795983338b45aa/html5/thumbnails/14.jpg)
If you’re going to deploy, then deploy.
14Monday, March 5, 2012
![Page 15: Ruby CI with Jenkins](https://reader034.vdocuments.us/reader034/viewer/2022051012/54639996af795983338b45aa/html5/thumbnails/15.jpg)
This is what we do
1. unpack application archive
2. restart server processes
15Monday, March 5, 2012
![Page 16: Ruby CI with Jenkins](https://reader034.vdocuments.us/reader034/viewer/2022051012/54639996af795983338b45aa/html5/thumbnails/16.jpg)
This is how we do it
16Monday, March 5, 2012
![Page 17: Ruby CI with Jenkins](https://reader034.vdocuments.us/reader034/viewer/2022051012/54639996af795983338b45aa/html5/thumbnails/17.jpg)
CI should verify a fully assembled application,
not just its source code
17Monday, March 5, 2012
![Page 18: Ruby CI with Jenkins](https://reader034.vdocuments.us/reader034/viewer/2022051012/54639996af795983338b45aa/html5/thumbnails/18.jpg)
Deploy a verified, fully assembled application.
18Monday, March 5, 2012
![Page 19: Ruby CI with Jenkins](https://reader034.vdocuments.us/reader034/viewer/2022051012/54639996af795983338b45aa/html5/thumbnails/19.jpg)
Deploy the output of your CI
19Monday, March 5, 2012
![Page 20: Ruby CI with Jenkins](https://reader034.vdocuments.us/reader034/viewer/2022051012/54639996af795983338b45aa/html5/thumbnails/20.jpg)
What we assemble
• Source Code
• Gem Bundle
• Static Assets (rails 3.1/Sprockets)
• Passenger
• Ruby
20Monday, March 5, 2012
![Page 21: Ruby CI with Jenkins](https://reader034.vdocuments.us/reader034/viewer/2022051012/54639996af795983338b45aa/html5/thumbnails/21.jpg)
Deployable
Discard
Pass
Fail
21Monday, March 5, 2012
![Page 22: Ruby CI with Jenkins](https://reader034.vdocuments.us/reader034/viewer/2022051012/54639996af795983338b45aa/html5/thumbnails/22.jpg)
Winning
• No (or very few) network dependencies
• No (or very few) host dependencies
• Fast!
• Idempotent deploys
22Monday, March 5, 2012
![Page 23: Ruby CI with Jenkins](https://reader034.vdocuments.us/reader034/viewer/2022051012/54639996af795983338b45aa/html5/thumbnails/23.jpg)
Ruby deploys suck because they grew up
with out CI
23Monday, March 5, 2012
![Page 24: Ruby CI with Jenkins](https://reader034.vdocuments.us/reader034/viewer/2022051012/54639996af795983338b45aa/html5/thumbnails/24.jpg)
Why Jenkins?
24Monday, March 5, 2012
![Page 25: Ruby CI with Jenkins](https://reader034.vdocuments.us/reader034/viewer/2022051012/54639996af795983338b45aa/html5/thumbnails/25.jpg)
Zero-Config Installapt-get install jenkinsyum install jenkinschef, puppet and friends
25Monday, March 5, 2012
![Page 26: Ruby CI with Jenkins](https://reader034.vdocuments.us/reader034/viewer/2022051012/54639996af795983338b45aa/html5/thumbnails/26.jpg)
Open Source
26Monday, March 5, 2012
![Page 27: Ruby CI with Jenkins](https://reader034.vdocuments.us/reader034/viewer/2022051012/54639996af795983338b45aa/html5/thumbnails/27.jpg)
Extensible400+ plugins to date
27Monday, March 5, 2012
![Page 28: Ruby CI with Jenkins](https://reader034.vdocuments.us/reader034/viewer/2022051012/54639996af795983338b45aa/html5/thumbnails/28.jpg)
Ruby Tools!Command Line
Plugin SDK
28Monday, March 5, 2012
![Page 29: Ruby CI with Jenkins](https://reader034.vdocuments.us/reader034/viewer/2022051012/54639996af795983338b45aa/html5/thumbnails/29.jpg)
Ruby CLI
29Monday, March 5, 2012
![Page 30: Ruby CI with Jenkins](https://reader034.vdocuments.us/reader034/viewer/2022051012/54639996af795983338b45aa/html5/thumbnails/30.jpg)
Ruby PluginsLive Coding!!!
30Monday, March 5, 2012
![Page 31: Ruby CI with Jenkins](https://reader034.vdocuments.us/reader034/viewer/2022051012/54639996af795983338b45aa/html5/thumbnails/31.jpg)
• cowboyd@github
• cowboyd@twitter
Ruby CI with Jenkins
31Monday, March 5, 2012