SlideShare a Scribd company logo
Jenkins User Conference          New York, May 17 2011   #jenkinsconf


       Graduating To Jenkins CI For
       Ruby(-on-Rails) Teams


                 Daniel Doubrovkine
                 @dblockdotorg
                 @artsy
Jenkins User Conference   New York, May 17 2011   #jenkinsconf



   Microsoft

     BuildTracker
     Distributed Build System
     Company-Wide SaS
     Lab w/ 400 Machines*




   * zomg!
Jenkins User Conference   New York, May 17 2011   #jenkinsconf



   Enterprise Software
     Windows Scheduler*
     CruiseControl Java
     CruiseControl.NET




   * zomg?
Jenkins User Conference   New York, May 17 2011   #jenkinsconf



   RoR Shop
     CIJoe
     Written in Ruby*
     Tiny Footprint
     One Project




   * yay?
Jenkins User Conference   New York, May 17 2011   #jenkinsconf



    Why NOT Jenkins?
      Not Written in Ruby
      We’re Too Small
      Written in Java
      Java is Big & Slow
      Too Much Maintenance
      I Just Need One Build
      No ANSI Color Support


We actually didn’t try it …
Jenkins User Conference                              New York, May 17 2011                   #jenkinsconf



   Running Jenkins for $19
     “Joe” on Linode’s Smallest Plan
      useradd -m jenkins -p [password] -s /bin/bash
      addgroup jenkins sudo
      wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add –
      sudo sh -c 'echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list.d/jenkins.list'
      sudo aptitude update sudo aptitude install jenkins
      change port in /etc/default/jenkins
      Manage Jenkins, Configure System, change Jenkins URL
      service jenkins restart




     Manage Jenkins, Configure System
     http://joe.example.com:9000/

      –   Enable Security
      –   Jenkins Own Database
      –   Add A User (eg. Joe)
      –   Matrix-Based Security
      –   Give Joe Permission to do Everything
      –   Configure Git Plugin w/ Global Username & Email
      –   Configure SMTP E-Mail Notification
      –   Configure Github Web Hook
          http://joe:[password]@joe.example.com:9000/github-webhook
Jenkins User Conference                                New York, May 17 2011   #jenkinsconf



   Plugins

     Git
     http://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin

     GithubAPI
     https://wiki.jenkins-ci.org/display/JENKINS/GitHub+API+Plugin


     AnsiColor
     http://wiki.jenkins-ci.org/display/JENKINS/AnsiColor+Plugin


     thinBackup
     https://wiki.jenkins-ci.org/display/JENKINS/thinBackup



     ChuckNorris
     http://wiki.hudson-ci.org/display/HUDSON/ChuckNorris+Plugin
Jenkins User Conference   New York, May 17 2011   #jenkinsconf



   Ruby/Rails Build Environment
     SSH Key
     Git
     RVM
     Github SSH Access
     Heroku SSH Access
Jenkins User Conference       New York, May 17 2011   #jenkinsconf



   A Project
     New Job
      – FreeStyle Project
      – Configure Github Project
      – Configure Git Repository

     Build Script
     #!/bin/bash
     source ~/.bash_profile
     rvm use 1.9.2
     gem install bundler
     bundle install
     bundle exec rake
Jenkins User Conference                              New York, May 17 2011                   #jenkinsconf



   Jenkins Jobs: Dev Build
     Headless Test w/ XVFB
     http://artsy.github.com/blog/2012/05/15/how-to-organize-over-3000-rspec-specs-and-retry-test-failures/
     rake test:ci

     namespace :test do

       task :specs, [ :display ] => :environment do |t, args|
        ENV['DISPLAY'] = args[:display] if args[:display]
        Rake::Task['spec:suite:all'].invoke
       end

       task :jasmine, [ :display ] => :environment do |t, args|
         ENV['DISPLAY'] = args[:display] if args[:display]
         system!("bundle exec rake jasmine:ci")
       end

       task :all, [ :display ] => :environment do |t, args|
           Rake::Task['assets'].invoke
           Rake::Task['test:jasmine'].invoke(args[:display])
         Rake::Task['test:specs'].invoke(args[:display])
       end

       task :ci do
         Rake::Task['test:all'].invoke(":99")
       end

     end
Jenkins User Conference                     New York, May 17 2011         #jenkinsconf



    Jenkins Job: Deploy
       Deploy to Staging
       Deploy to Production
       rake deploy:production
       rake deploy:staging


def system!(cmdline)
  logger.info("[#{Time.now}] #{cmdline}")
  rc = system(cmdline)
  "failed with exit code #{$?.exitstatus}" if (rc.nil? || ! rc || $?.exitstatus != 0)
end

namespace :deploy do
  task :staging => :environment do
    system!("bundle exec heroku maintenance:on --app=app-staging")
    system!("git push git@heroku.com:app-staging.git origin/staging:master")
    system!("bundle exec heroku maintenance:off --app=app-staging")
  end

  task :production => :environment do
    system!("git push git@heroku.com:app-production.git origin/production:master")
  end
end
Jenkins User Conference               New York, May 17 2011     #jenkinsconf



      Jenkins Job: Cron
       Daily Cron
       Weekly Cron


namespace :cron do

  task :daily => :environment do
    Rake::Task['db:production:backup'].invoke
    system!("heroku rake db:delayed_tasks:daily:run --app=app-production")
  end

  task :weekly => :environment do
    Rake::Task['db:production:archive'].invoke
  end

end
Jenkins User Conference   New York, May 17 2011   #jenkinsconf
Jenkins User Conference      New York, May 17 2011   #jenkinsconf



   Jenkins AnsiColor Plugin
   https://github.com/john-griffin/jenkins-client


     Eliminate Boring Output
Jenkins User Conference   New York, May 17 2011   #jenkinsconf



   Jenkins-Client Ruby Gem
   https://github.com/john-griffin/jenkins-client

     Start a Job
     List Builds
     Contribute!
Jenkins User Conference                 New York, May 17 2011   #jenkinsconf



      Chuck Norris Says




art.sy: http://art.sy
twitter: @dblockdotorg

blog: http://code.dblock.org

email: dblock@dblock.org

slides on slideshare: http://slideshare.net/dblockdotorg
Jenkins User Conference   New York, May 17 2011   #jenkinsconf



   Thank You To Our Sponsors
   Platinum
   Sponsor


   Gold
   Sponsors



   Silver
   Sponsors



   Bronze
   Sponsors

More Related Content

PDF
Jenkins Docker
PDF
JUC Europe 2015: Orchestrating Your Pipelines with Jenkins, Python and the Je...
PDF
Dockercon2015 bamboo
PPTX
Grooving with Jenkins
ODP
Scaling your jenkins master with docker
PDF
Jenkins Best Practices
PDF
Super Charged Configuration As Code
PPTX
Jenkins days workshop pipelines - Eric Long
Jenkins Docker
JUC Europe 2015: Orchestrating Your Pipelines with Jenkins, Python and the Je...
Dockercon2015 bamboo
Grooving with Jenkins
Scaling your jenkins master with docker
Jenkins Best Practices
Super Charged Configuration As Code
Jenkins days workshop pipelines - Eric Long

What's hot (20)

PDF
Continuous Integration/Deployment with Docker and Jenkins
PDF
JUC Europe 2015: Hey! What Did We Just Release?
PDF
Managing Jenkins with Jenkins (Jenkins User Conference Palo Alto, 2013)
PPTX
Seven Habits of Highly Effective Jenkins Users (2014 edition!)
PDF
Jenkins Best Practices Meetup Slides
PDF
JUC Europe 2015: The Famous Cows of Cambridge: A Non-Standard Use Case for Je...
PDF
OSDC 2017 - Julien Pivotto - Automating Jenkins
PDF
Continuous Delivery in Enterprise Environments using Docker, Ansible and Jenkins
PDF
Voxxed Luxembourd 2016 Jenkins 2.0 et Pipeline as code
PPTX
drone continuous Integration
PDF
JUC Europe 2015: Jenkins-Based Continuous Integration for Heterogeneous Hardw...
PPTX
Jenkins tutorial
PDF
Introduction to GitHub Actions
PDF
From Virtual Machines to Containers
PPTX
Jenkins multibranch pipeline workshop sep 2018
PDF
An Open-Source Chef Cookbook CI/CD Implementation Using Jenkins Pipelines
PPTX
JUC 2015 Pipeline Scaling
PPT
Jenkins Scriptler in 90mins
PDF
Deliver Python Apps with Docker
PDF
Deployment Automation with Docker
Continuous Integration/Deployment with Docker and Jenkins
JUC Europe 2015: Hey! What Did We Just Release?
Managing Jenkins with Jenkins (Jenkins User Conference Palo Alto, 2013)
Seven Habits of Highly Effective Jenkins Users (2014 edition!)
Jenkins Best Practices Meetup Slides
JUC Europe 2015: The Famous Cows of Cambridge: A Non-Standard Use Case for Je...
OSDC 2017 - Julien Pivotto - Automating Jenkins
Continuous Delivery in Enterprise Environments using Docker, Ansible and Jenkins
Voxxed Luxembourd 2016 Jenkins 2.0 et Pipeline as code
drone continuous Integration
JUC Europe 2015: Jenkins-Based Continuous Integration for Heterogeneous Hardw...
Jenkins tutorial
Introduction to GitHub Actions
From Virtual Machines to Containers
Jenkins multibranch pipeline workshop sep 2018
An Open-Source Chef Cookbook CI/CD Implementation Using Jenkins Pipelines
JUC 2015 Pipeline Scaling
Jenkins Scriptler in 90mins
Deliver Python Apps with Docker
Deployment Automation with Docker
Ad

Similar to Graduating to Jenkins CI for Ruby(-on-Rails) Teams (20)

PDF
Jenkins data mining on the command line - Jenkins User Conference NYC 2012
PDF
JUC NYC 2012: Yale Build and Deployment with Jenkins
PPTX
Drupal Continuous Integration with Jenkins - The Basics
PPTX
Drupal Continuous Integration with Jenkins - Deploy
PPT
Jenkins CI
PPTX
Introduction to jenkins
ODP
Jenkins and rails app - Le Dinh Vu
PDF
Jenkins-CI
PDF
Continuous Cross Platform Mobile App Development using Jenkins Build Server
PDF
Jenkins Tutorial.pdf
PPTX
Best Practices for Mission-Critical Jenkins
PDF
Juc boston2014.pptx
PPTX
Getting started with Jenkins
PPTX
varun JENKINS.pptx
PPTX
Jenkins User Conference 2013: Literate, multi-branch, mobile and more
PPTX
Build using jenkins on rtc repository
PDF
Continuous Integration using Jenkins with Python
ODP
An Introduction To Jenkins
PDF
Jenkins CI
PDF
OSDC 2017 | Automating Jenkins by Julien Pivotto
Jenkins data mining on the command line - Jenkins User Conference NYC 2012
JUC NYC 2012: Yale Build and Deployment with Jenkins
Drupal Continuous Integration with Jenkins - The Basics
Drupal Continuous Integration with Jenkins - Deploy
Jenkins CI
Introduction to jenkins
Jenkins and rails app - Le Dinh Vu
Jenkins-CI
Continuous Cross Platform Mobile App Development using Jenkins Build Server
Jenkins Tutorial.pdf
Best Practices for Mission-Critical Jenkins
Juc boston2014.pptx
Getting started with Jenkins
varun JENKINS.pptx
Jenkins User Conference 2013: Literate, multi-branch, mobile and more
Build using jenkins on rtc repository
Continuous Integration using Jenkins with Python
An Introduction To Jenkins
Jenkins CI
OSDC 2017 | Automating Jenkins by Julien Pivotto
Ad

More from Daniel Doubrovkine (20)

PDF
The Future of Art @ Worlds Fair Nano
PDF
Nasdaq CTO Summit: Inspiring Team Leads to Give Away Legos
PDF
Product Development 101
PDF
Open-Source by Default, UN Community.camp
PDF
Your First Slack Ruby Bot
PDF
Single Sign-On with Waffle
PDF
How it All Goes Down
PDF
Taking Over Open Source Projects @ GoGaRuCo 2014
PDF
Mentoring Engineers & Humans
PDF
Tiling and Zooming ASCII Art @ iOSoho
PDF
Artsy ♥ ASCII ART
PDF
The Other Side of Your Interview
PDF
Hiring Engineers (the Artsy Way)
PDF
Mentoring 101 - the Artsy way
PPTX
Building and Scaling a Test Driven Culture
PPTX
Introducing Remote Install Framework
PDF
HackYale 0-60 in Startup Tech
PDF
Taming the Testing Beast - AgileDC 2012
PDF
GeneralAssemb.ly Summer Program: Tech from the Ground Up
PDF
Making Agile Choices in Software Technology
The Future of Art @ Worlds Fair Nano
Nasdaq CTO Summit: Inspiring Team Leads to Give Away Legos
Product Development 101
Open-Source by Default, UN Community.camp
Your First Slack Ruby Bot
Single Sign-On with Waffle
How it All Goes Down
Taking Over Open Source Projects @ GoGaRuCo 2014
Mentoring Engineers & Humans
Tiling and Zooming ASCII Art @ iOSoho
Artsy ♥ ASCII ART
The Other Side of Your Interview
Hiring Engineers (the Artsy Way)
Mentoring 101 - the Artsy way
Building and Scaling a Test Driven Culture
Introducing Remote Install Framework
HackYale 0-60 in Startup Tech
Taming the Testing Beast - AgileDC 2012
GeneralAssemb.ly Summer Program: Tech from the Ground Up
Making Agile Choices in Software Technology

Recently uploaded (20)

PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Spectroscopy.pptx food analysis technology
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Encapsulation theory and applications.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
Cloud computing and distributed systems.
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Per capita expenditure prediction using model stacking based on satellite ima...
Advanced methodologies resolving dimensionality complications for autism neur...
NewMind AI Weekly Chronicles - August'25 Week I
sap open course for s4hana steps from ECC to s4
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Encapsulation_ Review paper, used for researhc scholars
Spectroscopy.pptx food analysis technology
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Understanding_Digital_Forensics_Presentation.pptx
Encapsulation theory and applications.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Digital-Transformation-Roadmap-for-Companies.pptx
Chapter 3 Spatial Domain Image Processing.pdf
Cloud computing and distributed systems.
Reach Out and Touch Someone: Haptics and Empathic Computing
Network Security Unit 5.pdf for BCA BBA.
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Build a system with the filesystem maintained by OSTree @ COSCUP 2025

Graduating to Jenkins CI for Ruby(-on-Rails) Teams

  • 1. Jenkins User Conference New York, May 17 2011 #jenkinsconf Graduating To Jenkins CI For Ruby(-on-Rails) Teams Daniel Doubrovkine @dblockdotorg @artsy
  • 2. Jenkins User Conference New York, May 17 2011 #jenkinsconf Microsoft BuildTracker Distributed Build System Company-Wide SaS Lab w/ 400 Machines* * zomg!
  • 3. Jenkins User Conference New York, May 17 2011 #jenkinsconf Enterprise Software Windows Scheduler* CruiseControl Java CruiseControl.NET * zomg?
  • 4. Jenkins User Conference New York, May 17 2011 #jenkinsconf RoR Shop CIJoe Written in Ruby* Tiny Footprint One Project * yay?
  • 5. Jenkins User Conference New York, May 17 2011 #jenkinsconf Why NOT Jenkins? Not Written in Ruby We’re Too Small Written in Java Java is Big & Slow Too Much Maintenance I Just Need One Build No ANSI Color Support We actually didn’t try it …
  • 6. Jenkins User Conference New York, May 17 2011 #jenkinsconf Running Jenkins for $19 “Joe” on Linode’s Smallest Plan useradd -m jenkins -p [password] -s /bin/bash addgroup jenkins sudo wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add – sudo sh -c 'echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list.d/jenkins.list' sudo aptitude update sudo aptitude install jenkins change port in /etc/default/jenkins Manage Jenkins, Configure System, change Jenkins URL service jenkins restart Manage Jenkins, Configure System http://joe.example.com:9000/ – Enable Security – Jenkins Own Database – Add A User (eg. Joe) – Matrix-Based Security – Give Joe Permission to do Everything – Configure Git Plugin w/ Global Username & Email – Configure SMTP E-Mail Notification – Configure Github Web Hook http://joe:[password]@joe.example.com:9000/github-webhook
  • 7. Jenkins User Conference New York, May 17 2011 #jenkinsconf Plugins Git http://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin GithubAPI https://wiki.jenkins-ci.org/display/JENKINS/GitHub+API+Plugin AnsiColor http://wiki.jenkins-ci.org/display/JENKINS/AnsiColor+Plugin thinBackup https://wiki.jenkins-ci.org/display/JENKINS/thinBackup ChuckNorris http://wiki.hudson-ci.org/display/HUDSON/ChuckNorris+Plugin
  • 8. Jenkins User Conference New York, May 17 2011 #jenkinsconf Ruby/Rails Build Environment SSH Key Git RVM Github SSH Access Heroku SSH Access
  • 9. Jenkins User Conference New York, May 17 2011 #jenkinsconf A Project New Job – FreeStyle Project – Configure Github Project – Configure Git Repository Build Script #!/bin/bash source ~/.bash_profile rvm use 1.9.2 gem install bundler bundle install bundle exec rake
  • 10. Jenkins User Conference New York, May 17 2011 #jenkinsconf Jenkins Jobs: Dev Build Headless Test w/ XVFB http://artsy.github.com/blog/2012/05/15/how-to-organize-over-3000-rspec-specs-and-retry-test-failures/ rake test:ci namespace :test do task :specs, [ :display ] => :environment do |t, args| ENV['DISPLAY'] = args[:display] if args[:display] Rake::Task['spec:suite:all'].invoke end task :jasmine, [ :display ] => :environment do |t, args| ENV['DISPLAY'] = args[:display] if args[:display] system!("bundle exec rake jasmine:ci") end task :all, [ :display ] => :environment do |t, args| Rake::Task['assets'].invoke Rake::Task['test:jasmine'].invoke(args[:display]) Rake::Task['test:specs'].invoke(args[:display]) end task :ci do Rake::Task['test:all'].invoke(":99") end end
  • 11. Jenkins User Conference New York, May 17 2011 #jenkinsconf Jenkins Job: Deploy Deploy to Staging Deploy to Production rake deploy:production rake deploy:staging def system!(cmdline) logger.info("[#{Time.now}] #{cmdline}") rc = system(cmdline) "failed with exit code #{$?.exitstatus}" if (rc.nil? || ! rc || $?.exitstatus != 0) end namespace :deploy do task :staging => :environment do system!("bundle exec heroku maintenance:on --app=app-staging") system!("git push git@heroku.com:app-staging.git origin/staging:master") system!("bundle exec heroku maintenance:off --app=app-staging") end task :production => :environment do system!("git push git@heroku.com:app-production.git origin/production:master") end end
  • 12. Jenkins User Conference New York, May 17 2011 #jenkinsconf Jenkins Job: Cron Daily Cron Weekly Cron namespace :cron do task :daily => :environment do Rake::Task['db:production:backup'].invoke system!("heroku rake db:delayed_tasks:daily:run --app=app-production") end task :weekly => :environment do Rake::Task['db:production:archive'].invoke end end
  • 13. Jenkins User Conference New York, May 17 2011 #jenkinsconf
  • 14. Jenkins User Conference New York, May 17 2011 #jenkinsconf Jenkins AnsiColor Plugin https://github.com/john-griffin/jenkins-client Eliminate Boring Output
  • 15. Jenkins User Conference New York, May 17 2011 #jenkinsconf Jenkins-Client Ruby Gem https://github.com/john-griffin/jenkins-client Start a Job List Builds Contribute!
  • 16. Jenkins User Conference New York, May 17 2011 #jenkinsconf Chuck Norris Says art.sy: http://art.sy twitter: @dblockdotorg blog: http://code.dblock.org email: dblock@dblock.org slides on slideshare: http://slideshare.net/dblockdotorg
  • 17. Jenkins User Conference New York, May 17 2011 #jenkinsconf Thank You To Our Sponsors Platinum Sponsor Gold Sponsors Silver Sponsors Bronze Sponsors