Continuous Integration For Rails Project
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share

Continuous Integration For Rails Project

  • 5,924 views
Uploaded on

introduce continuous integration into the development process. choose integrity since it’s light-weighted, easy to configure, good support for git and works for ourselves on our own install.

introduce continuous integration into the development process. choose integrity since it’s light-weighted, easy to configure, good support for git and works for ourselves on our own install.

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
  • rails integration integrity
    Are you sure you want to
    Your message goes here
  • Wonderful speech, Thanks, Louie
    Are you sure you want to
    Your message goes here
No Downloads

Views

Total Views
5,924
On Slideshare
5,379
From Embeds
545
Number of Embeds
3

Actions

Shares
Downloads
89
Comments
2
Likes
15

Embeds 545

http://www.in-src.com 438
http://in-src.com 73
http://www.slideshare.net 34

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Continuous Integration For Rails Project IN-SRC Studio Louie Zhao
  • 2. Continuous Integration • A software development practice where members of a team integrate their work frequently • Each integration is verified by an automated build (including test) • significantly reduced integration problems
  • 3. Firefox Tinderbox http://tinderbox.mozilla.org/showbuilds.cgi?tree=Firefox
  • 4. Continuous Integration • Maintain a code repository • Automate the build • Every commit should be built • Make the build self-testing • Keep the build fast • Everyone can see the results
  • 5. CI Solutions for Rails • CruiseControl.rb http://cruisecontrolrb.thoughtworks.com/ • Cerberus http://cerberus.rubyforge.org/ • Run Code Run http://runcoderun.com/ • Integrity http://integrityapp.com/
  • 6. Integrity • light-weighted • easy to configure • good support for git • works on our own install.
  • 7. Integrity Production developer Git Push git Build Notification developer repository developer developer CI Server Email Notification
  • 8. Integrity - Installation • Server Configuration • SUSE Linux • Apache • Passenger • MySQL 5.x
  • 9. Integrity - Build • The building environment is almost identical to your development environment • Standalone CI server • DB Server • rake ci WITH_PACKAGE_TEST=1
  • 10. Integrity - Installation http://www.in-src.com/continuous_integration_for_rails_project • $ gem install --passenger integrity • $ integrity install [integrity-diretory] • $ integrity migrate_db config.yml
  • 11. Integrity - Source • local git repository • /var/git/[project-name].git • remote git repository • ssh://[user]@[hostname]/var/git/[project-name].git
  • 12. Integrity - Git Hook Up • git post-receive • POST_RECEIVE_URL • Daemons
  • 13. Integrity - Email Notification
  • 14. Integrity - Build
  • 15. Integrity - Build
  • 16. Integrity - Build
  • 17. Integrity • Trouble Shooting • http://www.in-src.com/ continuous_integration_for_rails_project
  • 18. Metric Fu • a set of rake tasks • Saikuro, Flog, Flay, Rcov, Reek, Roodi • sudo gem install jscruggs-metric_fu • rake metrics:all • generate metrics reports
  • 19. Metric Fu - Configuration
  • 20. Metric Fu
  • 21. Rcov
  • 22. Rcov
  • 23. Churn
  • 24. Flay
  • 25. Flog The higher the score, the harder it is to test
  • 26. Flog Code Seen as flog flog report class Test class Test Test#blah: (11.2) def blah def blah # 11.2 = 6.0: eval a = eval "1+1" a = eval "1+1" # 1.2 + 6.0 + 1.2: branch if a == 2 then if a == 2 then # 1.2 + 1.2 + 0.4 + 1.2: == puts "yay" puts "yay" # 1.2 1.2: puts end end 1.2: assignment end end 0.4: lit_fixnum end end
  • 27. Reek • detects common code smells might be hard to read, • Class Variable maintain or evolve, • Control Couple rather than things that are specifically • Data Clump wrong • Duplication • Feature Envy • Large Class • Long Method • Long Parameter List • Nested Iterators • Simulated Polymorphism • Uncommunicative Name • Utility Function
  • 28. Reek Duplication Feature Envy def double_thing() class Cart @other.thing + @other.thing def price end @item.price + @item.tax end end def double_thing() class Cart thing = @other.thing def price thing + thing @item.price_with_tax end end end class Item def price_with_tax price + tax end end
  • 29. Reek
  • 30. Roodi
  • 31. Roodi • warns you about design issues • AssignmentInConditionalCheck • CaseMissingElseCheck • ClassLineCountCheck • ClassNameCheck • CyclomaticComplexityBlockCheck • CyclomaticComplexityMethodCheck • EmptyRescueBodyCheck • ForLoopCheck • MethodLineCountCheck • MethodNameCheck • ModuleLineCountCheck • ModuleNameCheck • ParameterNumberCheck
  • 32. Stats
  • 33. Thank You! louiezhao@in-src.com