O slideshow foi denunciado.
Utilizamos seu perfil e dados de atividades no LinkedIn para personalizar e exibir anúncios mais relevantes. Altere suas preferências de anúncios quando desejar.

Continuous Integration

2.143 visualizações

Publicada em

Experience report on CI, Hudson and branch management.

Publicada em: Tecnologia
  • Seja o primeiro a comentar

  • Seja a primeira pessoa a gostar disto

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

×