Upload
harald-soevik
View
15
Download
0
Embed Size (px)
DESCRIPTION
Experience report on CI, Hudson and branch management.
Citation preview
© Computas AS
Continuous Integration - an experience report -
Harald SøvikComputas AS
© Computas AS
Outline
• The Mats Project• Branch- and release management• Build servers• Experience with Hudson • Thoughts and ideas
© 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
© Computas AS
The Mats Project
© Computas AS
The Mats Project
© Computas AS
The Mats Project
• Core technologies• Java 1.6• Java EE5• JBoss 4.2• Oracle RAC 10g• webMethods 6.5
© Computas AS
The Mats Project
• Dev tools• IntelliJ IDEA 8.1• Subversion 1.6• Maven 2.0
• Testing tools• VMware• Windows TS / Citrix• Linux
© 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
© 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.?...
© 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
© Computas AS
Cruise Control
© 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 !
© 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
© Computas AS
Hudson
© Computas AS
© Computas AS
Hudson
• GUI• Lots of files in ~/.hudson• Lots of plugins• Watch build output• Access workspace• RSS, email, IM• Slave builds• More stable !
© Computas AS
Hudson jobs
• Deploy at once• deploy to mavenrep• pros and cons
• “Pipeline build”• one job per module• primary tests• build dependents
© Computas AS
Hudson slaves
• “Keep the Build Fast”• SSH slaves• pki, mvn, svn
• UI testing• watir• selenium
© Computas AS
Hudson: deploy !
• Environments• Deploy immediately• Deploy nightly • Deploy weekly• “Value chain”-tests
• Automation• Single click build• Database scripts
© Computas AS
Hudson metrics
• mvn site• PMD• CPD• NCSS• surefire• findbugs• changelog
© Computas AS
Hudson and branches
• Problem:• A > B > C• B is being branched
• B’
• Can B’ break C without knowing ?
© 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’
© 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’
Continuous deployment
• Deploy into production• Unit tests• Integration tests• Performance tests• UI tests• Then: immediately!
© Computas AS
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