27
© Computas AS Continuous Integration - an experience report - Harald Søvik Computas AS

Continuous Integration

Embed Size (px)

DESCRIPTION

Experience report on CI, Hudson and branch management.

Citation preview

Page 1: Continuous Integration

© Computas AS

Continuous Integration - an experience report -

Harald SøvikComputas AS

Page 2: Continuous Integration

© Computas AS

Outline

• The Mats Project• Branch- and release management• Build servers• Experience with Hudson • Thoughts and ideas

Page 3: Continuous Integration

© Computas AS

The Mats Project

• Norwegian Food Safety Authority• 20-30 developers• 4 years of development• 6 years of maintenance (15 devs)• ~50 integration points• Swing and web

Page 4: Continuous Integration

© Computas AS

The Mats Project

Page 5: Continuous Integration

© Computas AS

The Mats Project

Page 6: Continuous Integration

© Computas AS

The Mats Project

• Core technologies• Java 1.6• Java EE5• JBoss 4.2• Oracle RAC 10g• webMethods 6.5

Page 7: Continuous Integration

© Computas AS

The Mats Project

• Dev tools• IntelliJ IDEA 8.1• Subversion 1.6• Maven 2.0

• Testing tools• VMware• Windows TS / Citrix• Linux

Page 8: Continuous Integration

© Computas AS

The Mats Project

• One development branch • scrum• 3 teams á 5 devs• sprints á 4-5 weeks• 10-15 sprints in each release

• One maintenance branch• 1 team á ~7 devs• scrumban, kanban, ...• release each 3 weeks

Page 9: Continuous Integration

© Computas AS

Branch- and release management1.0-SNAPSHOT

2.0-SNAPSHOT

3.0-SNAPSHOT

4.0-SNAPSHOT

...

1.0.0 1.0.17...

2.0.0 2.1.9...

3.0.0 3.0.14...

4.0.0 4.1.?...

Page 10: Continuous Integration

© Computas AS

Branch- and release management

• Each branch:• Build server• Reference environment• Test environment• Verification environment• Unit- and integration tests• Doc and maven site• Tools, build plugins• DB scripts• Appserver configuration

Page 11: Continuous Integration

© Computas AS

Cruise Control

Page 12: Continuous Integration

© Computas AS

Cruise Control

• Simple interface• Monolithic configuration file• No connection build/job• Some plugins• Difficult to express complex build jobs• Difficult to access build artifacts

• .. unable to abort builds !

Page 13: Continuous Integration

© Computas AS

CI tools

• CruiseControl• the original

• Continuum• the maven way

• Luntbuild• the challenger

• Hudson• the new kid in town

http://groups.google.com/group/EtoE/browse_thread/thread/b6675c74c03a621b

Page 14: Continuous Integration

© Computas AS

Hudson

Page 15: Continuous Integration

© Computas AS

Page 16: Continuous Integration

© Computas AS

Hudson

• GUI• Lots of files in ~/.hudson• Lots of plugins• Watch build output• Access workspace• RSS, email, IM• Slave builds• More stable !

Page 17: Continuous Integration
Page 18: Continuous Integration

© Computas AS

Hudson jobs

• Deploy at once• deploy to mavenrep• pros and cons

• “Pipeline build”• one job per module• primary tests• build dependents

Page 19: Continuous Integration

© Computas AS

Hudson slaves

• “Keep the Build Fast”• SSH slaves• pki, mvn, svn

• UI testing• watir• selenium

Page 20: Continuous Integration

© Computas AS

Hudson: deploy !

• Environments• Deploy immediately• Deploy nightly • Deploy weekly• “Value chain”-tests

• Automation• Single click build• Database scripts

Page 21: Continuous Integration

© Computas AS

Hudson metrics

• mvn site• PMD• CPD• NCSS• surefire• findbugs• changelog

Page 22: Continuous Integration

© Computas AS

Hudson and branches

• Problem:• A > B > C• B is being branched

• B’

• Can B’ break C without knowing ?

Page 23: Continuous Integration

© Computas AS

Hudson and branches

• Solution 1: Yes, of course:• B’ should be a job• C’ should be a job !• Breakage should be instant !

A B C

B’ C’

Page 24: Continuous Integration

© Computas AS

Hudson and branches

• Solution 2: That is not a problem• All dependencies should be static• Entire tree is private• No breakage until merge

A B C

B’ C’A’

Page 25: Continuous Integration

Continuous deployment

• Deploy into production• Unit tests• Integration tests• Performance tests• UI tests• Then: immediately!

© Computas AS

Page 26: Continuous Integration

Continuous deployment

• No interruption to the end user• Upgrade ”live” objects• Upgrade ”live” configuration• Redeploy quicker than change frequency• Change must be immutable• Trustworthy tests

• Promote changesets !

© Computas AS

Page 27: Continuous Integration

Thanks !

twitter.com/harals

[email protected]

© Computas AS