SlideShare a Scribd company logo
Continuous Delivery
in Ruby
Srushti Ambekallu    Brian Guthrie
@srshti              @bguthrie
github.com/srushti   github.com/bguthrie
Delivering great software
Continuous Delivery in Ruby
Continuous Delivery in Ruby
Continuous Delivery in Ruby
Continuous Integration
1.Unit and integration tests
RSpec or Test::Unit
Tests of specific units of code
      Tests of multiple layers
Tests of external integration points
Receive
              new
             commit

Reset test
database
 schema
                  Run tests


                                Reset
                              test data
Receive
              new
             commit

Reset test
database
 schema
                  Run tests


                                Reset
                              test data
1.Unit and integration tests

2.Automated acceptance tests
Cucumber or the test runner of your choice
Selenium or Sahi
    Capybara
Receive
                new
               commit

Reset test                    Run
                                        Reset
database                    browser
                                      test data
 schema                       tests


             Restart test
               server
1.Unit and integration tests

2.Automated acceptance tests

3.User acceptance tests
Continuous Delivery in Ruby
type              click
         click

       click     click
type              click
         click

       click     click
                   click
                  click    click
       click
        click              type
type                    click
          click

        click        click
                          click
                         click    click
        click
         click                    type

                                  click
click            click
                           type
type                    click
          click

        click        click
                          click           click
                         click    click
        click
         click                    type
                                            click
                                  click
click            click
                           type
click

 type                    click                               type
          click                          click click
                                      click
        click        click
                          click                    click
                         click    click
        click
         click                    type
                                                     click
                                  click
click            click
                           type
click

 type                    click                              type
          click                         click click
                                     click
        click        click

                         ERROR
                          click
                         click
                            click
                                                  click

        click
         click                    type
                                                    click
                                  click
click            click
                           type
1.Unit and integration tests

2.Automated acceptance tests

3.User acceptance tests
1.Unit and integration tests

2.Automated acceptance tests
2a.Deploy
3.User acceptance tests
Deployment
Super easy in Ruby
(those Java guys are suckers)
$ ssh root@production.com
$ ssh root@production.com
prod:~ root# cd /var/www/site
$ ssh root@production.com
prod:~ root# cd /var/www/site
prod:~ root# git pull a31a0eb569ba2
$ ssh root@production.com
prod:~ root# cd /var/www/site
prod:~ root# git pull a31a0eb569ba2
prod:~ root# bundle install
$ ssh root@production.com
prod:~ root# cd /var/www/site
prod:~ root# git pull a31a0eb569ba2
prod:~ root# bundle install
prod:~ root# rake db:migrate
$ ssh root@production.com
prod:~ root# cd /var/www/site
prod:~ root# git pull a31a0eb569ba2
prod:~ root# bundle install
prod:~ root# rake db:migrate
prod:~ root# rake jammit:package
$ ssh root@production.com
prod:~ root# cd /var/www/site
prod:~ root# git pull a31a0eb569ba2
prod:~ root# bundle install
prod:~ root# rake db:migrate
prod:~ root# rake jammit:package
prod:~ root# touch tmp/restart.txt
$ cap deploy production
Why automate?
Digression: The Rails deploy model
$ ssh root@production.com
$ ssh root@production.com

prod:~ root# git clone git@scm/myapp.git /var/www/site/a31a0eb569ba2
$ ssh root@production.com

prod:~ root# git clone git@scm/myapp.git /var/www/site/a31a0eb569ba2

prod:~ root# ln -s /var/ww/site/current /var/www/site/a31a0eb569ba2
$ ssh root@production.com

prod:~ root# git clone git@scm/myapp.git /var/www/site/a31a0eb569ba2

prod:~ root# ln -s /var/ww/site/current /var/www/site/a31a0eb569ba2

prod:~ root# bundle install
$ ssh root@production.com

prod:~ root# git clone git@scm/myapp.git /var/www/site/a31a0eb569ba2

prod:~ root# ln -s /var/ww/site/current /var/www/site/a31a0eb569ba2

prod:~ root# bundle install

prod:~ root# rake db:migrate
$ ssh root@production.com

prod:~ root# git clone git@scm/myapp.git /var/www/site/a31a0eb569ba2

prod:~ root# ln -s /var/ww/site/current /var/www/site/a31a0eb569ba2

prod:~ root# bundle install

prod:~ root# rake db:migrate

prod:~ root# rake jammit:package
$ ssh root@production.com

prod:~ root# git clone git@scm/myapp.git /var/www/site/a31a0eb569ba2

prod:~ root# ln -s /var/ww/site/current /var/www/site/a31a0eb569ba2

prod:~ root# bundle install

prod:~ root# rake db:migrate

prod:~ root# rake jammit:package

prod:~ root# touch tmp/restart.txt
$ ssh root@production.com

prod:~ root# git clone git@scm/myapp.git /var/www/site/a31a0eb569ba2

prod:~ root# ln -s /var/ww/site/current /var/www/site/a31a0eb569ba2

prod:~ root# bundle install

prod:~ root# rake db:migrate

prod:~ root# rake jammit:package

prod:~ root# touch tmp/restart.txt
ci-server:~/app/ $ bundle install --deployment

ci-server:~/app/ $ rake jammit:package

ci-server:~/app/ $ tar zxvf app-<SHA>.tgz *
RVM
RVM
Not for production
$ cat ~/projecta/.rvmrc
rvm jruby@projecta

$ cat ~/projecta/.rvmrc
rvm ree@projectb

$ cat ~/projecta/.rvmrc
rvm 1.9.1@projectc
Environments
App
server
App
server

 App
server

 App
server
App
server
         Background
         jobs server
 App
server

 App
server
App
           server
                    Background
                    jobs server
            App
 Load
           server
balancer

            App
           server
App
           server
                    Background
                    jobs server
            App
 Load
           server
balancer

            App
           server
                    Background
                    jobs server
            App
           server
Chef
Chef
Puppet
App
           server
                    Background
                    jobs server
            App
 Load
           server
balancer

            App
           server
                    Background
                    jobs server
            App
           server
Configuration
Management


                           App
                          server
                                   Background
                                   jobs server
                           App
                Load
                          server
               balancer

                           App
                          server
                                   Background
                                   jobs server
                           App
                          server
Continuous Delivery in Ruby
Peace in the kingdom
How often?
Project Lifecycle
   faf4d2788f   .........................   a433f20abb




Code                                           Release
                        Six months
Project Lifecycle
  faf4d2788f   f26115c8c   c86c1bfea6   56d1dd8accc4   dd35192f8 1b51fee653a   f038af17de4   8318b750aec   192410bd2537


       631f5c3f58c                             7bcafdd2266
                                                                                       2bbed3e4bd2



Code                                                                                                               Release
                                                 Every week
                                                  (iteration)
Project Lifecycle
             f26115c8c                  dd35192f8   f038af17de4


       631f5c3f58c        7bcafdd2266




Code                                                              Release
                             Every day?
Project Lifecycle
         7bcafdd2266

Code                       Release
        Multiple times
          a day??
Features long in development need branches
Branch by abstraction
(“if this feature is enabled, show this link”)
<% if feature?(:masala) %>
  <%= render :partial => "dosas/masala",
        :locals => { :dosa => @dosas.masala.first } %>
<% else %>
  <%= render :partial => "dosas/plain",
        :locals => { :dosa => @dosas.first } %>
<% end %>
This doesn’t work for everything:
   big features, config changes
Branch by source control
      (“fork me”)




  http://martinfowler.com/bliki/FeatureBranch.html
The Build Pipeline
“...an automated manifestation of your process for
   getting software from version control into the
                hands of your users.”
                     - Jez Humble and David Farley, Continuous Delivery
Unit and     Automated      Manual
Integration   Acceptance   Acceptance   Production
                                         (Woohoo!)
   Tests         Tests        Tests
Test     Test     Test
              runner   runner   runner


                        Test
                       runner




 Unit and         Automated                Manual
Integration       Acceptance             Acceptance   Production
                                                       (Woohoo!)
   Tests             Tests                  Tests
“I see CI as primarily giving birth to a release
candidate at each commit. The job of the CI
system and deployment process is to disprove
the production-readiness of a release candidate.
This model relies on the need to have some
mainline that represents the current shared, most
up to date picture of complete.”
                                   - David Farley
Automate until human intervention = decision

                 DEPLOY
Internal                 External
                             users                    users



  Feature                                  User
              Continuous
development                   Staging   acceptance    Production
              integration
  Bug fixes                                testing
Continuous Delivery in Ruby
Continuous Delivery in Ruby
Continuous Delivery in Ruby
Human beings
Continuous Delivery in Ruby
Real testing is hard
Let computers do the simple testing
  Smart humans for smart testing
Automated testing
                       User testing




Traditional projects
Automated testing
           User testing




Agilify!
Agilify!
Questions?
   Srushti Ambekallu
   @srshti
   github.com/srushti

   Brian Guthrie
   @bguthrie
   github.com/bguthrie

More Related Content

PDF
OpenID Connect - An Emperor or Just New Cloths?
PDF
CIS13: Bootcamp: Ping Identity OAuth and OpenID Connect In Action with PingFe...
KEY
Advanced Ruby Idioms So Clean You Can Eat Off Of Them
PPTX
Hadoop Summit 2012 | Optimizing MapReduce Job Performance
KEY
Hybrid MongoDB and RDBMS Applications
PDF
Core MIDI and Friends
PPT
Ruby For Java Programmers
PDF
Optimizing Hive Queries
OpenID Connect - An Emperor or Just New Cloths?
CIS13: Bootcamp: Ping Identity OAuth and OpenID Connect In Action with PingFe...
Advanced Ruby Idioms So Clean You Can Eat Off Of Them
Hadoop Summit 2012 | Optimizing MapReduce Job Performance
Hybrid MongoDB and RDBMS Applications
Core MIDI and Friends
Ruby For Java Programmers
Optimizing Hive Queries

Similar to Continuous Delivery in Ruby (20)

PDF
Develop Ruby Applications Fast | TubroRuby
PDF
Agile Adoption: Does it Have to be All In or Fold?
PDF
On Software Release Engineering (Bram Adams)
PDF
Moving from Django Apps to Services
PDF
Continuous Deployment – Nextdoor.fi released every day at Scan-Agile 2011
PDF
Beyond The Timesheet
KEY
Continuous Integration, the minimum viable product
PDF
ChannelStream: The challenges of continuously delivering
PDF
The Challenge of Continuously Delivering
PDF
IBM Ported Tools for z/OS User’s Guide
PDF
Continuous Delivery Overview
PDF
Process Matters (Cloud2Days / Java2Days conference))
PDF
The Web Development Eco-system with VSTS, ASP.NET 2.0 & Microsoft Ajax
PDF
Blue Monitor Systems Software Development Services
PDF
Blue Monitor Software Development
KEY
Infrastrucutre as sdlc
PPTX
Architecting for continuous delivery (33rd Degree)
PDF
Drupal Estimation Techniques by Project Managers
PDF
Practical functional java script
PDF
Cluemapper Lightning Talk
Develop Ruby Applications Fast | TubroRuby
Agile Adoption: Does it Have to be All In or Fold?
On Software Release Engineering (Bram Adams)
Moving from Django Apps to Services
Continuous Deployment – Nextdoor.fi released every day at Scan-Agile 2011
Beyond The Timesheet
Continuous Integration, the minimum viable product
ChannelStream: The challenges of continuously delivering
The Challenge of Continuously Delivering
IBM Ported Tools for z/OS User’s Guide
Continuous Delivery Overview
Process Matters (Cloud2Days / Java2Days conference))
The Web Development Eco-system with VSTS, ASP.NET 2.0 & Microsoft Ajax
Blue Monitor Systems Software Development Services
Blue Monitor Software Development
Infrastrucutre as sdlc
Architecting for continuous delivery (33rd Degree)
Drupal Estimation Techniques by Project Managers
Practical functional java script
Cluemapper Lightning Talk
Ad

Recently uploaded (20)

PDF
CIFDAQ's Token Spotlight: SKY - A Forgotten Giant's Comeback?
PDF
Google’s NotebookLM Unveils Video Overviews
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
CIFDAQ's Market Wrap: Ethereum Leads, Bitcoin Lags, Institutions Shift
PDF
Sensors and Actuators in IoT Systems using pdf
PDF
REPORT: Heating appliances market in Poland 2024
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PPTX
Belt and Road Supply Chain Finance Blockchain Solution
PDF
AI And Its Effect On The Evolving IT Sector In Australia - Elevate
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPTX
How to Build Crypto Derivative Exchanges from Scratch.pptx
PDF
KodekX | Application Modernization Development
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Top Generative AI Tools for Patent Drafting in 2025.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
CroxyProxy Instagram Access id login.pptx
PDF
CIFDAQ's Teaching Thursday: Moving Averages Made Simple
PDF
A Day in the Life of Location Data - Turning Where into How.pdf
PDF
NewMind AI Monthly Chronicles - July 2025
CIFDAQ's Token Spotlight: SKY - A Forgotten Giant's Comeback?
Google’s NotebookLM Unveils Video Overviews
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
CIFDAQ's Market Wrap: Ethereum Leads, Bitcoin Lags, Institutions Shift
Sensors and Actuators in IoT Systems using pdf
REPORT: Heating appliances market in Poland 2024
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Belt and Road Supply Chain Finance Blockchain Solution
AI And Its Effect On The Evolving IT Sector In Australia - Elevate
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
How to Build Crypto Derivative Exchanges from Scratch.pptx
KodekX | Application Modernization Development
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Top Generative AI Tools for Patent Drafting in 2025.pdf
Chapter 3 Spatial Domain Image Processing.pdf
CroxyProxy Instagram Access id login.pptx
CIFDAQ's Teaching Thursday: Moving Averages Made Simple
A Day in the Life of Location Data - Turning Where into How.pdf
NewMind AI Monthly Chronicles - July 2025
Ad

Continuous Delivery in Ruby

  • 1. Continuous Delivery in Ruby Srushti Ambekallu Brian Guthrie @srshti @bguthrie github.com/srushti github.com/bguthrie
  • 9. Tests of specific units of code Tests of multiple layers Tests of external integration points
  • 10. Receive new commit Reset test database schema Run tests Reset test data
  • 11. Receive new commit Reset test database schema Run tests Reset test data
  • 12. 1.Unit and integration tests 2.Automated acceptance tests
  • 13. Cucumber or the test runner of your choice
  • 14. Selenium or Sahi Capybara
  • 15. Receive new commit Reset test Run Reset database browser test data schema tests Restart test server
  • 16. 1.Unit and integration tests 2.Automated acceptance tests 3.User acceptance tests
  • 18. type click click click click
  • 19. type click click click click click click click click click type
  • 20. type click click click click click click click click click type click click click type
  • 21. type click click click click click click click click click click type click click click click type
  • 22. click type click type click click click click click click click click click click click click type click click click click type
  • 23. click type click type click click click click click click ERROR click click click click click click type click click click click type
  • 24. 1.Unit and integration tests 2.Automated acceptance tests 3.User acceptance tests
  • 25. 1.Unit and integration tests 2.Automated acceptance tests 2a.Deploy 3.User acceptance tests
  • 27. Super easy in Ruby (those Java guys are suckers)
  • 29. $ ssh [email protected] prod:~ root# cd /var/www/site
  • 30. $ ssh [email protected] prod:~ root# cd /var/www/site prod:~ root# git pull a31a0eb569ba2
  • 31. $ ssh [email protected] prod:~ root# cd /var/www/site prod:~ root# git pull a31a0eb569ba2 prod:~ root# bundle install
  • 32. $ ssh [email protected] prod:~ root# cd /var/www/site prod:~ root# git pull a31a0eb569ba2 prod:~ root# bundle install prod:~ root# rake db:migrate
  • 33. $ ssh [email protected] prod:~ root# cd /var/www/site prod:~ root# git pull a31a0eb569ba2 prod:~ root# bundle install prod:~ root# rake db:migrate prod:~ root# rake jammit:package
  • 34. $ ssh [email protected] prod:~ root# cd /var/www/site prod:~ root# git pull a31a0eb569ba2 prod:~ root# bundle install prod:~ root# rake db:migrate prod:~ root# rake jammit:package prod:~ root# touch tmp/restart.txt
  • 35. $ cap deploy production
  • 37. Digression: The Rails deploy model
  • 39. $ ssh [email protected] prod:~ root# git clone git@scm/myapp.git /var/www/site/a31a0eb569ba2
  • 40. $ ssh [email protected] prod:~ root# git clone git@scm/myapp.git /var/www/site/a31a0eb569ba2 prod:~ root# ln -s /var/ww/site/current /var/www/site/a31a0eb569ba2
  • 41. $ ssh [email protected] prod:~ root# git clone git@scm/myapp.git /var/www/site/a31a0eb569ba2 prod:~ root# ln -s /var/ww/site/current /var/www/site/a31a0eb569ba2 prod:~ root# bundle install
  • 42. $ ssh [email protected] prod:~ root# git clone git@scm/myapp.git /var/www/site/a31a0eb569ba2 prod:~ root# ln -s /var/ww/site/current /var/www/site/a31a0eb569ba2 prod:~ root# bundle install prod:~ root# rake db:migrate
  • 43. $ ssh [email protected] prod:~ root# git clone git@scm/myapp.git /var/www/site/a31a0eb569ba2 prod:~ root# ln -s /var/ww/site/current /var/www/site/a31a0eb569ba2 prod:~ root# bundle install prod:~ root# rake db:migrate prod:~ root# rake jammit:package
  • 44. $ ssh [email protected] prod:~ root# git clone git@scm/myapp.git /var/www/site/a31a0eb569ba2 prod:~ root# ln -s /var/ww/site/current /var/www/site/a31a0eb569ba2 prod:~ root# bundle install prod:~ root# rake db:migrate prod:~ root# rake jammit:package prod:~ root# touch tmp/restart.txt
  • 45. $ ssh [email protected] prod:~ root# git clone git@scm/myapp.git /var/www/site/a31a0eb569ba2 prod:~ root# ln -s /var/ww/site/current /var/www/site/a31a0eb569ba2 prod:~ root# bundle install prod:~ root# rake db:migrate prod:~ root# rake jammit:package prod:~ root# touch tmp/restart.txt
  • 46. ci-server:~/app/ $ bundle install --deployment ci-server:~/app/ $ rake jammit:package ci-server:~/app/ $ tar zxvf app-<SHA>.tgz *
  • 47. RVM
  • 49. $ cat ~/projecta/.rvmrc rvm jruby@projecta $ cat ~/projecta/.rvmrc rvm ree@projectb $ cat ~/projecta/.rvmrc rvm 1.9.1@projectc
  • 53. App server Background jobs server App server App server
  • 54. App server Background jobs server App Load server balancer App server
  • 55. App server Background jobs server App Load server balancer App server Background jobs server App server
  • 56. Chef
  • 58. App server Background jobs server App Load server balancer App server Background jobs server App server
  • 59. Configuration Management App server Background jobs server App Load server balancer App server Background jobs server App server
  • 61. Peace in the kingdom
  • 63. Project Lifecycle faf4d2788f ......................... a433f20abb Code Release Six months
  • 64. Project Lifecycle faf4d2788f f26115c8c c86c1bfea6 56d1dd8accc4 dd35192f8 1b51fee653a f038af17de4 8318b750aec 192410bd2537 631f5c3f58c 7bcafdd2266 2bbed3e4bd2 Code Release Every week (iteration)
  • 65. Project Lifecycle f26115c8c dd35192f8 f038af17de4 631f5c3f58c 7bcafdd2266 Code Release Every day?
  • 66. Project Lifecycle 7bcafdd2266 Code Release Multiple times a day??
  • 67. Features long in development need branches
  • 68. Branch by abstraction (“if this feature is enabled, show this link”) <% if feature?(:masala) %> <%= render :partial => "dosas/masala", :locals => { :dosa => @dosas.masala.first } %> <% else %> <%= render :partial => "dosas/plain", :locals => { :dosa => @dosas.first } %> <% end %>
  • 69. This doesn’t work for everything: big features, config changes
  • 70. Branch by source control (“fork me”) http://martinfowler.com/bliki/FeatureBranch.html
  • 72. “...an automated manifestation of your process for getting software from version control into the hands of your users.” - Jez Humble and David Farley, Continuous Delivery
  • 73. Unit and Automated Manual Integration Acceptance Acceptance Production (Woohoo!) Tests Tests Tests
  • 74. Test Test Test runner runner runner Test runner Unit and Automated Manual Integration Acceptance Acceptance Production (Woohoo!) Tests Tests Tests
  • 75. “I see CI as primarily giving birth to a release candidate at each commit. The job of the CI system and deployment process is to disprove the production-readiness of a release candidate. This model relies on the need to have some mainline that represents the current shared, most up to date picture of complete.” - David Farley
  • 76. Automate until human intervention = decision DEPLOY
  • 77. Internal External users users Feature User Continuous development Staging acceptance Production integration Bug fixes testing
  • 83. Real testing is hard Let computers do the simple testing Smart humans for smart testing
  • 84. Automated testing User testing Traditional projects
  • 85. Automated testing User testing Agilify!
  • 87. Questions? Srushti Ambekallu @srshti github.com/srushti Brian Guthrie @bguthrie github.com/bguthrie

Editor's Notes