Ruby CI with Jenkins

Post on 12-Nov-2014

5.881 views 7 download

Tags:

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 of Ruby CI with Jenkins

• cowboyd@github

• cowboyd@twitter

Ruby CI with Jenkins

1Monday, March 5, 2012

Your Development Process Needs CI

2Monday, March 5, 2012

Not for code quality*

* this is still very important3Monday, March 5, 2012

For deployment

4Monday, March 5, 2012

You Need CI.CI is crucial to

application distribution

5Monday, March 5, 2012

Ruby deploys suck

6Monday, March 5, 2012

Typical Deploy

• check out from source control

• bundle gems

• generate assets (rails/sprockets)

• and then more stuff...

7Monday, March 5, 2012

Deploying from SCM sucks

8Monday, March 5, 2012

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

Bundling gems at deploy-time sucks

10Monday, March 5, 2012

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

Asset generation on deploy sucks

12Monday, March 5, 2012

Asset generation on deploy sucks

• time consuming

• not tested anywhere else until go-time

13Monday, March 5, 2012

If you’re going to deploy, then deploy.

14Monday, March 5, 2012

This is what we do

1. unpack application archive

2. restart server processes

15Monday, March 5, 2012

This is how we do it

16Monday, March 5, 2012

CI should verify a fully assembled application,

not just its source code

17Monday, March 5, 2012

Deploy a verified, fully assembled application.

18Monday, March 5, 2012

Deploy the output of your CI

19Monday, March 5, 2012

What we assemble

• Source Code

• Gem Bundle

• Static Assets (rails 3.1/Sprockets)

• Passenger

• Ruby

20Monday, March 5, 2012

Deployable

Discard

Pass

Fail

21Monday, March 5, 2012

Winning

• No (or very few) network dependencies

• No (or very few) host dependencies

• Fast!

• Idempotent deploys

22Monday, March 5, 2012

Ruby deploys suck because they grew up

with out CI

23Monday, March 5, 2012

Why Jenkins?

24Monday, March 5, 2012

Zero-Config Installapt-get install jenkinsyum install jenkinschef, puppet and friends

25Monday, March 5, 2012

Open Source

26Monday, March 5, 2012

Extensible400+ plugins to date

27Monday, March 5, 2012

Ruby Tools!Command Line

Plugin SDK

28Monday, March 5, 2012

Ruby CLI

29Monday, March 5, 2012

Ruby PluginsLive Coding!!!

30Monday, March 5, 2012

• cowboyd@github

• cowboyd@twitter

Ruby CI with Jenkins

31Monday, March 5, 2012