SlideShare ist ein Scribd-Unternehmen logo
1 von 87
Continuous Delivery
in Ruby
Srushti Ambekallu    Brian Guthrie
@srshti              @bguthrie
github.com/srushti   github.com/bguthrie
Delivering great software
Continuous Integration
1.Unit and integration tests
RSpec or Test::Unit
Tests of speciïŹc 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
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
ConïŹguration
Management


                           App
                          server
                                   Background
                                   jobs server
                           App
                Load
                          server
               balancer

                           App
                          server
                                   Background
                                   jobs server
                           App
                          server
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, conïŹg 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 ïŹxes                                testing
Human beings
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

Weitere Àhnliche Inhalte

Andere mochten auch

Hybrid MongoDB and RDBMS Applications
Hybrid MongoDB and RDBMS ApplicationsHybrid MongoDB and RDBMS Applications
Hybrid MongoDB and RDBMS Applications
Steven Francia
 

Andere mochten auch (9)

Hybrid MongoDB and RDBMS Applications
Hybrid MongoDB and RDBMS ApplicationsHybrid MongoDB and RDBMS Applications
Hybrid MongoDB and RDBMS Applications
 
Core MIDI and Friends
Core MIDI and FriendsCore MIDI and Friends
Core MIDI and Friends
 
Ruby For Java Programmers
Ruby For Java ProgrammersRuby For Java Programmers
Ruby For Java Programmers
 
Optimizing Hive Queries
Optimizing Hive QueriesOptimizing Hive Queries
Optimizing Hive Queries
 
How To Solder V3.5
How To Solder V3.5How To Solder V3.5
How To Solder V3.5
 
Powering Interactive Data Analysis at Pinterest by Amazon Redshift
Powering Interactive Data Analysis at Pinterest by Amazon RedshiftPowering Interactive Data Analysis at Pinterest by Amazon Redshift
Powering Interactive Data Analysis at Pinterest by Amazon Redshift
 
Callbacks, Promises, and Coroutines (oh my!): Asynchronous Programming Patter...
Callbacks, Promises, and Coroutines (oh my!): Asynchronous Programming Patter...Callbacks, Promises, and Coroutines (oh my!): Asynchronous Programming Patter...
Callbacks, Promises, and Coroutines (oh my!): Asynchronous Programming Patter...
 
(DVO401) Deep Dive into Blue/Green Deployments on AWS
(DVO401) Deep Dive into Blue/Green Deployments on AWS(DVO401) Deep Dive into Blue/Green Deployments on AWS
(DVO401) Deep Dive into Blue/Green Deployments on AWS
 
10+ Deploys Per Day: Dev and Ops Cooperation at Flickr
10+ Deploys Per Day: Dev and Ops Cooperation at Flickr10+ Deploys Per Day: Dev and Ops Cooperation at Flickr
10+ Deploys Per Day: Dev and Ops Cooperation at Flickr
 

Ähnlich wie Continuous Delivery in Ruby

Virtualize and automate your development environment for fun and profit
Virtualize and automate your development environment for fun and profitVirtualize and automate your development environment for fun and profit
Virtualize and automate your development environment for fun and profit
Andreas Heim
 
Test driven infrastructure development (2 - puppetconf 2013 edition)
Test driven infrastructure development (2 - puppetconf 2013 edition)Test driven infrastructure development (2 - puppetconf 2013 edition)
Test driven infrastructure development (2 - puppetconf 2013 edition)
Tomas Doran
 
How penetration testing techniques can help you improve your qa skills
How penetration testing techniques can help you improve your qa skillsHow penetration testing techniques can help you improve your qa skills
How penetration testing techniques can help you improve your qa skills
Marian Marinov
 
Tec314
Tec314Tec314
Tec314
John Art
 
David Nuescheler: Igniting CQ 5.3: What's New and Roadmap
David Nuescheler: Igniting CQ 5.3: What's New and RoadmapDavid Nuescheler: Igniting CQ 5.3: What's New and Roadmap
David Nuescheler: Igniting CQ 5.3: What's New and Roadmap
Day Software
 

Ähnlich wie Continuous Delivery in Ruby (20)

Clearly, I Have Made Some Bad Decisions
Clearly, I Have Made Some Bad DecisionsClearly, I Have Made Some Bad Decisions
Clearly, I Have Made Some Bad Decisions
 
To Host, Or Not To Host?
To Host, Or Not To Host?To Host, Or Not To Host?
To Host, Or Not To Host?
 
Enjoy privacy on Gitlab
Enjoy privacy on GitlabEnjoy privacy on Gitlab
Enjoy privacy on Gitlab
 
Virtualize and automate your development environment for fun and profit
Virtualize and automate your development environment for fun and profitVirtualize and automate your development environment for fun and profit
Virtualize and automate your development environment for fun and profit
 
TDD - for people who don't need it
TDD - for people who don't need itTDD - for people who don't need it
TDD - for people who don't need it
 
Symfony Live NYC 2014 - Rock Solid Deployment of Symfony Apps
Symfony Live NYC 2014 -  Rock Solid Deployment of Symfony AppsSymfony Live NYC 2014 -  Rock Solid Deployment of Symfony Apps
Symfony Live NYC 2014 - Rock Solid Deployment of Symfony Apps
 
Test driven infrastructure development (2 - puppetconf 2013 edition)
Test driven infrastructure development (2 - puppetconf 2013 edition)Test driven infrastructure development (2 - puppetconf 2013 edition)
Test driven infrastructure development (2 - puppetconf 2013 edition)
 
How penetration testing techniques can help you improve your qa skills
How penetration testing techniques can help you improve your qa skillsHow penetration testing techniques can help you improve your qa skills
How penetration testing techniques can help you improve your qa skills
 
Monkeybars in the Manor
Monkeybars in the ManorMonkeybars in the Manor
Monkeybars in the Manor
 
SymfonyCon Madrid 2014 - Rock Solid Deployment of Symfony Apps
SymfonyCon Madrid 2014 - Rock Solid Deployment of Symfony AppsSymfonyCon Madrid 2014 - Rock Solid Deployment of Symfony Apps
SymfonyCon Madrid 2014 - Rock Solid Deployment of Symfony Apps
 
What's new in CQ 5.3? Top 10 features.
What's new in CQ 5.3? Top 10 features.What's new in CQ 5.3? Top 10 features.
What's new in CQ 5.3? Top 10 features.
 
Tec314
Tec314Tec314
Tec314
 
Team Development and Release Management
Team Development and Release ManagementTeam Development and Release Management
Team Development and Release Management
 
How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem
How Do Developers React to API Deprecation? The Case of a Smalltalk EcosystemHow Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem
How Do Developers React to API Deprecation? The Case of a Smalltalk Ecosystem
 
Automate your build on Android with Jenkins
Automate your build on Android with JenkinsAutomate your build on Android with Jenkins
Automate your build on Android with Jenkins
 
SFSCON23 - Denver Gingerich - How do you really do GPL enforcement
SFSCON23 - Denver Gingerich - How do you really do GPL enforcementSFSCON23 - Denver Gingerich - How do you really do GPL enforcement
SFSCON23 - Denver Gingerich - How do you really do GPL enforcement
 
DEFCON 23 - Mike Sconzo - i am packer and so can you
DEFCON 23 - Mike Sconzo - i am packer and so can youDEFCON 23 - Mike Sconzo - i am packer and so can you
DEFCON 23 - Mike Sconzo - i am packer and so can you
 
David Nuescheler: Igniting CQ 5.3: What's New and Roadmap
David Nuescheler: Igniting CQ 5.3: What's New and RoadmapDavid Nuescheler: Igniting CQ 5.3: What's New and Roadmap
David Nuescheler: Igniting CQ 5.3: What's New and Roadmap
 
Making the Most of User Changes
Making the Most of User ChangesMaking the Most of User Changes
Making the Most of User Changes
 
Rocket Fuelled Cucumbers
Rocket Fuelled CucumbersRocket Fuelled Cucumbers
Rocket Fuelled Cucumbers
 

KĂŒrzlich hochgeladen

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

KĂŒrzlich hochgeladen (20)

The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
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?
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
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
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
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)
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 

Continuous Delivery in Ruby

Hinweis der Redaktion

  1. \n
  2. \n
  3. \n
  4. \n
  5. Brian - skeptic (&amp;#x201C;what do I need tests for?&amp;#x201D;)\nSrushti - champion\n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. Brian - champion (&amp;#x201C;I deploy all the time - I GUESS you could automate&amp;#x201D;)\nSrushti - skeptic\n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n
  52. \n
  53. \n
  54. \n
  55. \n
  56. \n
  57. \n
  58. \n
  59. \n
  60. \n
  61. \n
  62. \n
  63. \n
  64. Brian - champion, Srushti - skeptic\n
  65. \n
  66. \n
  67. \n
  68. \n
  69. \n
  70. \n
  71. \n
  72. \n
  73. \n
  74. \n
  75. \n
  76. Brian - more rapid, then convinced to be slower\nSrushti - slower, then convinced to be more rapid\n
  77. \n
  78. \n
  79. \n
  80. \n
  81. \n
  82. \n
  83. \n
  84. \n
  85. \n
  86. Brian - skeptic because wants slower deploys, Srushti - champion\n
  87. \n
  88. \n
  89. \n
  90. \n
  91. \n
  92. \n
  93. \n
  94. \n
  95. Etsy - will open source later\n
  96. Brian - skeptic (&amp;#x201C;I used to have an army of testers&amp;#x201D;)\nSrushti - champion\n
  97. \n
  98. \n
  99. \n
  100. \n
  101. \n
  102. \n