Published on

Continuous integration with Hudson

Published in: Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide


  1. 1. Continuous integration-Case Study- Hudson<br />Munteanu Liviu Andrei<br />TIE - an 2<br />
  2. 2. Content<br />What`s CI ?<br />Prerequisites <br />Hudson Benefits<br />Plugins<br />Special Study – Eclipse Plugins<br />Lessons Learned<br />Conclusions<br />Demo<br />
  3. 3. What’s Continuous Integration?<br />•Martin Fowler sez:<br />Continuous Integration is a software development practice where members of a team integrate their work frequently, usually each person integrates at least daily - leading to multiple integrations per day. Each integration is verified by an automated build (including test) to detect integration errors as quickly as possible. Many teams find that this approach leads to significantly reduced integration problems and allows a team to develop cohesive software more rapidly.<br />
  4. 4. How Developers Code<br />while ( not done ) {<br /> write some code;<br /> test by poking at it tediously;<br /> fix the bugs you see;<br />}<br />deploy;<br />cross your fingers nobody finds new bugs;<br />return;<br />
  5. 5. Continuous Integration: <br />Some Free Systems<br />• Cruise Control - Java-based framework for a continuous build process<br />• BuildBot - Open Source Python system to automate thecompile/test cycle to validate code <br />• Hudson -  a continuous integration tool written in Java<br />
  6. 6. Basic Continuous Integration<br />• Check the code repo for changes every few minutes<br />• Build or compile the code<br />• Run your tests: unit, regresssion, etc<br /> • of course you have to have tests to run!<br />• Alert if problems<br />
  7. 7. Prerequisites:<br />Automated Build<br /> • No human intervention allowed<br /> • ant, maven<br /> •, pip, buildout (every language has one)<br />Code that Tests Your Code<br /> • Can run without firing up the whole stack (web framework, security, ...)<br /> • unit tests: junit, nose, ...<br /> • functional tests: selenium, abott, ...<br /> • Run locally before checking in: “don’t break the build”<br />
  8. 8. Hudson Benefits<br />• Never gets bored doing builds and tests<br />• Catches problems fast<br />• Alerts developers while code is fresh in their minds<br />• Prevents bugs from propagating downstream<br />• Cheaper to fix bugs earlier, before QA or Deployment<br />
  9. 9. Helpful Plugins<br />Source code management<br />Build triggers<br />Build tools<br />Slave launchers and controllers<br />Build reports<br />External site/tool integrations<br />UI plugins<br />Authentication and user management<br />Cluster management and distributed build<br />CLI extensions<br />
  10. 10. Helpful Plugins<br />• Subversion: code repo checkout <br />• Cobertura: test coverage reporter<br />• Maven: many plugins available<br />• JDepend: Java package dependency analyzer => design quality metrics.<br />• PMD: open source static code analysis tool looking for possiblebugs <br />• Checkstyle:  static code analysis tool checking source code compliancewith coding rules<br />• Selenium: functional, click-testing<br />• Monitor for Android: status on your phone<br />• Chuck Norris: motivational help :-)<br />
  11. 11. Eclipse Plugins<br />Prerequisites<br /><ul><li>A running instance of Hudson CI Server
  12. 12. The Buckminster Pluginfor Hudson</li></ul>Buckminster<br /><ul><li>frameworks and tools for automating build, assemble & deploy (BA&D) development processes  
  13. 13. creates an update site containing all the plugins, features and binary artifacts.
  14. 14. the build script will then utilize the p2 director application to create the actual product from the update site's content.
  15. 15. To make this action known to Buckminster a CSPECX is required</li></li></ul><li>Eclipse Plugins<br />Building a Target Platform<br /><ul><li>Target Platform contains the set of features and plugins that your source is build against.
  16. 16. For required featurescreate CQUERYs and MSPECs.</li></ul>Creating the Hudson Job<br /><ul><li>Start with a new Free-Style project that will create and publish the target platform for the App. 
  17. 17. The job needs two build steps: Execute Shell and Run Buckminster. The execute shell step will delete the directory where the target platform is materialized to ensure a clean build every time.
  18. 18. In the Run Buckminster build step you need to import the two MSPECs defined above.
  19. 19. The last thing that needs to be done in the target platform is archiving the build result and publishing it. So activate the post build action "Archive and publish an Eclipse Target Platform", set the directory to the value of ${targetPlatformPath} and name the resulting artifact.</li></li></ul><li>Lessons learned<br />• Automate your build<br />• Write tests for every piece of code<br />• Have code metrics<br />• Plan for a continuous integration from start<br />
  20. 20. Conclusions<br />• Hudson watches the code repo for commits<br />• Checks out code<br />• Builds it with your build ‘script’<br />• Runs your tests<br />• Reports problems by email and IM<br />• Tracks metrics, if available<br />
  21. 21. References <br /><ul><li>
  22. 22.
  23. 23.
  24. 24.</li></li></ul><li>Danger! Live Demo<br />
  25. 25. Danger! Live Demo<br />
  26. 26. Danger! Live Demo<br />
  27. 27. Danger! Live Demo<br />
  28. 28. Danger! Live Demo<br />
  29. 29. Danger! Live Demo<br />
  30. 30. Danger! Live Demo<br />
  31. 31. Danger! Live Demo<br />