Continuous Integration   -   an experience report - Harald Søvik Computas AS © Computas AS
Outline <ul><li>The Mats Project </li></ul><ul><li>Branch- and release management </li></ul><ul><li>Build servers </li></u...
The Mats Project <ul><li>Norwegian Food Safety Authority </li></ul><ul><li>20-30 developers </li></ul><ul><li>4 years of d...
The Mats Project © Computas AS
The Mats Project © Computas AS
The Mats Project <ul><li>Core technologies </li></ul><ul><ul><li>Java 1.6 </li></ul></ul><ul><ul><li>Java EE5 </li></ul></...
The Mats Project <ul><li>Dev tools </li></ul><ul><ul><li>IntelliJ IDEA 8.1 </li></ul></ul><ul><ul><li>Subversion 1.6 </li>...
The Mats Project <ul><li>One development branch  </li></ul><ul><ul><li>scrum </li></ul></ul><ul><ul><li>3 teams á 5 devs <...
Branch- and release management © Computas AS
Branch- and release management <ul><li>Each branch: </li></ul><ul><ul><li>Build server </li></ul></ul><ul><ul><li>Referenc...
Cruise Control © Computas AS
Cruise Control <ul><li>Simple interface </li></ul><ul><li>Monolithic configuration file </li></ul><ul><li>No connection bu...
CI tools <ul><li>CruiseControl </li></ul><ul><ul><li>the original </li></ul></ul><ul><li>Continuum </li></ul><ul><ul><li>t...
Hudson © Computas AS
© Computas AS
Hudson <ul><li>GUI </li></ul><ul><li>Lots of files in ~/.hudson </li></ul><ul><li>Lots of plugins </li></ul><ul><li>Watch ...
 
Hudson jobs <ul><li>Deploy at once </li></ul><ul><ul><li>deploy to mavenrep </li></ul></ul><ul><ul><li>pros and cons </li>...
Hudson slaves <ul><li>“ Keep the Build Fast” </li></ul><ul><li>SSH slaves </li></ul><ul><ul><li>pki, mvn, svn </li></ul></...
Hudson: deploy ! <ul><li>Environments </li></ul><ul><ul><li>Deploy immediately </li></ul></ul><ul><ul><li>Deploy nightly  ...
Hudson metrics <ul><li>mvn site </li></ul><ul><ul><li>PMD </li></ul></ul><ul><ul><li>CPD </li></ul></ul><ul><ul><li>NCSS <...
Hudson and branches <ul><li>Problem: </li></ul><ul><ul><li>A > B > C </li></ul></ul><ul><ul><li>B is being branched </li><...
Hudson and branches <ul><li>Solution 1: Yes, of course: </li></ul><ul><ul><li>B’ should be a job </li></ul></ul><ul><ul><l...
Hudson and branches <ul><li>Solution 2: That is not a problem </li></ul><ul><ul><li>All dependencies should be static </li...
Continuous deployment <ul><li>Deploy into production </li></ul><ul><ul><li>Unit tests </li></ul></ul><ul><ul><li>Integrati...
Continuous deployment <ul><li>No interruption to the end user </li></ul><ul><li>Upgrade ”live” objects </li></ul><ul><li>U...
Thanks ! <ul><li>twitter.com/harals </li></ul><ul><li>[email_address] </li></ul>© Computas AS
Upcoming SlideShare
Loading in...5
×

Continuous Integration

1,770

Published on

Experience report on CI, Hudson and branch management.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,770
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
48
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • -&gt; Important to maintain reproducability
  • Interface also over jmx. Simple to version control config in subversion Difficult to spot errors. Requires all builds to be sane before start. Complex build jobs: pipeline builds
  • several instances. each branch needs one instance if they do changes across the project
  • More difficult to keep config in SVN, and to create a new instance. Easier to create new jobs.
  • Mental break
  • Using maven and hudson to update various environments for testing.
  • PMD – Programming Mistake Detector CPD – Copy Paste Detection NCSS - Non Commenting Source Statements
  • ” Trust parent to detect if he breaks his child” Instant breakage, but a lot of effort during work. Trouble if a lot of artifacts has to be branched.
  • Do not trust parent to break me. ” Do not trust anyone, escpecially not parent” More stable, but postpones trouble.
  • Continuous Integration

    1. 1. Continuous Integration - an experience report - Harald Søvik Computas AS © Computas AS
    2. 2. Outline <ul><li>The Mats Project </li></ul><ul><li>Branch- and release management </li></ul><ul><li>Build servers </li></ul><ul><li>Experience with Hudson </li></ul><ul><li>Thoughts and ideas </li></ul>© Computas AS
    3. 3. The Mats Project <ul><li>Norwegian Food Safety Authority </li></ul><ul><li>20-30 developers </li></ul><ul><li>4 years of development </li></ul><ul><li>6 years of maintenance (15 devs) </li></ul><ul><li>~50 integration points </li></ul><ul><li>Swing and web </li></ul>© Computas AS
    4. 4. The Mats Project © Computas AS
    5. 5. The Mats Project © Computas AS
    6. 6. The Mats Project <ul><li>Core technologies </li></ul><ul><ul><li>Java 1.6 </li></ul></ul><ul><ul><li>Java EE5 </li></ul></ul><ul><ul><li>JBoss 4.2 </li></ul></ul><ul><ul><li>Oracle RAC 10g </li></ul></ul><ul><ul><li>webMethods 6.5 </li></ul></ul>© Computas AS
    7. 7. The Mats Project <ul><li>Dev tools </li></ul><ul><ul><li>IntelliJ IDEA 8.1 </li></ul></ul><ul><ul><li>Subversion 1.6 </li></ul></ul><ul><ul><li>Maven 2.0 </li></ul></ul><ul><li>Testing tools </li></ul><ul><ul><li>VMware </li></ul></ul><ul><ul><li>Windows TS / Citrix </li></ul></ul><ul><ul><li>Linux </li></ul></ul>© Computas AS
    8. 8. The Mats Project <ul><li>One development branch </li></ul><ul><ul><li>scrum </li></ul></ul><ul><ul><li>3 teams á 5 devs </li></ul></ul><ul><ul><li>sprints á 4-5 weeks </li></ul></ul><ul><ul><li>10-15 sprints in each release </li></ul></ul><ul><li>One maintenance branch </li></ul><ul><ul><li>1 team á ~7 devs </li></ul></ul><ul><ul><li>scrumban, kanban, ... </li></ul></ul><ul><ul><li>release each 3 weeks </li></ul></ul>© Computas AS
    9. 9. Branch- and release management © Computas AS
    10. 10. Branch- and release management <ul><li>Each branch: </li></ul><ul><ul><li>Build server </li></ul></ul><ul><ul><li>Reference environment </li></ul></ul><ul><ul><li>Test environment </li></ul></ul><ul><ul><li>Verification environment </li></ul></ul><ul><ul><li>Unit- and integration tests </li></ul></ul><ul><ul><li>Doc and maven site </li></ul></ul><ul><ul><li>Tools, build plugins </li></ul></ul><ul><ul><li>DB scripts </li></ul></ul><ul><ul><li>Appserver configuration </li></ul></ul>© Computas AS
    11. 11. Cruise Control © Computas AS
    12. 12. Cruise Control <ul><li>Simple interface </li></ul><ul><li>Monolithic configuration file </li></ul><ul><li>No connection build/job </li></ul><ul><li>Some plugins </li></ul><ul><li>Difficult to express complex build jobs </li></ul><ul><li>Difficult to access build artifacts </li></ul><ul><li>.. unable to abort builds ! </li></ul>© Computas AS
    13. 13. CI tools <ul><li>CruiseControl </li></ul><ul><ul><li>the original </li></ul></ul><ul><li>Continuum </li></ul><ul><ul><li>the maven way </li></ul></ul><ul><li>Luntbuild </li></ul><ul><ul><li>the challenger </li></ul></ul><ul><li>Hudson </li></ul><ul><ul><li>the new kid in town </li></ul></ul><ul><li>http://groups.google.com/group/EtoE/browse_thread/thread/b6675c74c03a621b </li></ul>© Computas AS
    14. 14. Hudson © Computas AS
    15. 15. © Computas AS
    16. 16. Hudson <ul><li>GUI </li></ul><ul><li>Lots of files in ~/.hudson </li></ul><ul><li>Lots of plugins </li></ul><ul><li>Watch build output </li></ul><ul><li>Access workspace </li></ul><ul><li>RSS, email, IM </li></ul><ul><li>Slave builds </li></ul><ul><li>More stable ! </li></ul>© Computas AS
    17. 18. Hudson jobs <ul><li>Deploy at once </li></ul><ul><ul><li>deploy to mavenrep </li></ul></ul><ul><ul><li>pros and cons </li></ul></ul><ul><li>“ Pipeline build” </li></ul><ul><ul><li>one job per module </li></ul></ul><ul><ul><li>primary tests </li></ul></ul><ul><ul><li>build dependents </li></ul></ul>© Computas AS
    18. 19. Hudson slaves <ul><li>“ Keep the Build Fast” </li></ul><ul><li>SSH slaves </li></ul><ul><ul><li>pki, mvn, svn </li></ul></ul><ul><li>UI testing </li></ul><ul><ul><li>watir </li></ul></ul><ul><ul><li>selenium </li></ul></ul>© Computas AS
    19. 20. Hudson: deploy ! <ul><li>Environments </li></ul><ul><ul><li>Deploy immediately </li></ul></ul><ul><ul><li>Deploy nightly </li></ul></ul><ul><ul><li>Deploy weekly </li></ul></ul><ul><ul><li>“ Value chain”-tests </li></ul></ul><ul><li>Automation </li></ul><ul><ul><li>Single click build </li></ul></ul><ul><ul><li>Database scripts </li></ul></ul>© Computas AS
    20. 21. Hudson metrics <ul><li>mvn site </li></ul><ul><ul><li>PMD </li></ul></ul><ul><ul><li>CPD </li></ul></ul><ul><ul><li>NCSS </li></ul></ul><ul><ul><li>surefire </li></ul></ul><ul><ul><li>findbugs </li></ul></ul><ul><ul><li>changelog </li></ul></ul>© Computas AS
    21. 22. Hudson and branches <ul><li>Problem: </li></ul><ul><ul><li>A > B > C </li></ul></ul><ul><ul><li>B is being branched </li></ul></ul><ul><ul><ul><li>B’ </li></ul></ul></ul><ul><ul><li>Can B’ break C without knowing ? </li></ul></ul>© Computas AS
    22. 23. Hudson and branches <ul><li>Solution 1: Yes, of course: </li></ul><ul><ul><li>B’ should be a job </li></ul></ul><ul><ul><li>C’ should be a job ! </li></ul></ul><ul><ul><li>Breakage should be instant ! </li></ul></ul>© Computas AS A B C B’ C’
    23. 24. Hudson and branches <ul><li>Solution 2: That is not a problem </li></ul><ul><ul><li>All dependencies should be static </li></ul></ul><ul><ul><li>Entire tree is private </li></ul></ul><ul><ul><li>No breakage until merge </li></ul></ul>© Computas AS A B C B’ C’ A’
    24. 25. Continuous deployment <ul><li>Deploy into production </li></ul><ul><ul><li>Unit tests </li></ul></ul><ul><ul><li>Integration tests </li></ul></ul><ul><ul><li>Performance tests </li></ul></ul><ul><ul><li>UI tests </li></ul></ul><ul><ul><li>Then: immediately! </li></ul></ul>© Computas AS
    25. 26. Continuous deployment <ul><li>No interruption to the end user </li></ul><ul><li>Upgrade ”live” objects </li></ul><ul><li>Upgrade ”live” configuration </li></ul><ul><li>Redeploy quicker than change frequency </li></ul><ul><li>Change must be immutable </li></ul><ul><li>Trustworthy tests </li></ul><ul><li>Promote changesets ! </li></ul>© Computas AS
    26. 27. Thanks ! <ul><li>twitter.com/harals </li></ul><ul><li>[email_address] </li></ul>© Computas AS
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×