SlideShare une entreprise Scribd logo
1  sur  17
Télécharger pour lire hors ligne
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

Contenu connexe

Tendances

Continuous Delivery in Enterprise Environments using Docker, Ansible and Jenkins
Continuous Delivery in Enterprise Environments using Docker, Ansible and JenkinsContinuous Delivery in Enterprise Environments using Docker, Ansible and Jenkins
Continuous Delivery in Enterprise Environments using Docker, Ansible and Jenkins
Marcel Birkner
 

Tendances (20)

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

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

Continuous Web Performance Monitoring with Jenkins
Continuous Web Performance Monitoring with JenkinsContinuous Web Performance Monitoring with Jenkins
Continuous Web Performance Monitoring with Jenkins
Michael Kröll
 

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

Jenkins data mining on the command line - Jenkins User Conference NYC 2012
Jenkins data mining on the command line - Jenkins User Conference NYC 2012Jenkins data mining on the command line - Jenkins User Conference NYC 2012
Jenkins data mining on the command line - Jenkins User Conference NYC 2012
 
Best Practices for Mission-Critical Jenkins
Best Practices for Mission-Critical JenkinsBest Practices for Mission-Critical Jenkins
Best Practices for Mission-Critical Jenkins
 
JUC NYC 2012: Yale Build and Deployment with Jenkins
JUC NYC 2012: Yale Build and Deployment with JenkinsJUC NYC 2012: Yale Build and Deployment with Jenkins
JUC NYC 2012: Yale Build and Deployment with Jenkins
 
Release with confidence
Release with confidenceRelease with confidence
Release with confidence
 
Going literate in Amadeus JUC Berlin June 25th 2014
Going literate in Amadeus JUC Berlin June 25th 2014Going literate in Amadeus JUC Berlin June 25th 2014
Going literate in Amadeus JUC Berlin June 25th 2014
 
Jenkins presentation
Jenkins presentationJenkins presentation
Jenkins presentation
 
JavaCro'14 - Continuous delivery of Java EE applications with Jenkins and Doc...
JavaCro'14 - Continuous delivery of Java EE applications with Jenkins and Doc...JavaCro'14 - Continuous delivery of Java EE applications with Jenkins and Doc...
JavaCro'14 - Continuous delivery of Java EE applications with Jenkins and Doc...
 
Jenkins, Bhyve, and Webdriver: Continuous Integration testing on FreeNAS by C...
Jenkins, Bhyve, and Webdriver: Continuous Integration testing on FreeNAS by C...Jenkins, Bhyve, and Webdriver: Continuous Integration testing on FreeNAS by C...
Jenkins, Bhyve, and Webdriver: Continuous Integration testing on FreeNAS by C...
 
Pipeline as code - new feature in Jenkins 2
Pipeline as code - new feature in Jenkins 2Pipeline as code - new feature in Jenkins 2
Pipeline as code - new feature in Jenkins 2
 
The Job DSL Plugin: Introduction & What’s New
The Job DSL Plugin: Introduction & What’s NewThe Job DSL Plugin: Introduction & What’s New
The Job DSL Plugin: Introduction & What’s New
 
Jenkins Pipelines
Jenkins PipelinesJenkins Pipelines
Jenkins Pipelines
 
Deployment Tactics
Deployment TacticsDeployment Tactics
Deployment Tactics
 
Ant, Maven and Jenkins
Ant, Maven and JenkinsAnt, Maven and Jenkins
Ant, Maven and Jenkins
 
Continuous Web Performance Monitoring with Jenkins
Continuous Web Performance Monitoring with JenkinsContinuous Web Performance Monitoring with Jenkins
Continuous Web Performance Monitoring with Jenkins
 
Stockholm Jenkins Area Meetup, March 2017
Stockholm Jenkins Area Meetup, March 2017Stockholm Jenkins Area Meetup, March 2017
Stockholm Jenkins Area Meetup, March 2017
 
(Declarative) Jenkins Pipelines
(Declarative) Jenkins Pipelines(Declarative) Jenkins Pipelines
(Declarative) Jenkins Pipelines
 
IBM Index 2018 Conference Workshop: Modernizing Traditional Java App's with D...
IBM Index 2018 Conference Workshop: Modernizing Traditional Java App's with D...IBM Index 2018 Conference Workshop: Modernizing Traditional Java App's with D...
IBM Index 2018 Conference Workshop: Modernizing Traditional Java App's with D...
 
Jenkins & IaC
Jenkins & IaCJenkins & IaC
Jenkins & IaC
 
Jenkins & Selenium
Jenkins & SeleniumJenkins & Selenium
Jenkins & Selenium
 
JUC Europe 2015: Configuration as Code: The Job DSL Plugin
JUC Europe 2015: Configuration as Code: The Job DSL PluginJUC Europe 2015: Configuration as Code: The Job DSL Plugin
JUC Europe 2015: Configuration as Code: The Job DSL Plugin
 

Plus de Daniel Doubrovkine

GeneralAssemb.ly Summer Program: Tech from the Ground Up
GeneralAssemb.ly Summer Program: Tech from the Ground UpGeneralAssemb.ly Summer Program: Tech from the Ground Up
GeneralAssemb.ly Summer Program: Tech from the Ground Up
Daniel Doubrovkine
 

Plus de Daniel Doubrovkine (20)

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

Dernier

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Dernier (20)

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 

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