Continuous Integration With Hudson1
Continuous Integration With Hudson1
with Hudson
Carlos Ors ([email protected])
Antoni Bertran ([email protected])
December 2010
Espai de paginació 2 / 25
Agenda
• Why Integration?
• What is Continuous Integration?
• Continuous Integration Process
• CI Infrastructure
• CI Tool: Hudson
• Demo in UOC Hudson: CampusGateway
Integration
• Modularization
– enables team development
– makes complex systems manageable
• Integrated Modules do successfully
– Compile
– Run
– Pass test
Integration Challenges
Broken Integration
• You have a broken integration when:
– Integration server does not build successfully
– Shared component works in one system, but
breaks others
– Unit tests fail
– Code quality fails (coding conventions, quality
metrics)
– Deployment fails
Manual Integration
• Integration becomes expensive
– if made manual (build, test, deployment, …)
– with too few checkin’s (hours or days…)
– If integration problems and bugs are detected
too late
• Reduces desire to refactor
Continuous Integration: definitions
Embrace Continuous Integration
• Work Process
– Commit/Update often (each change)
– Run often
– Tests
– Run test often
– Common code ownership
Continuous Integration Infrastructure
Deployment Server in UOC
• Maven Repository Manager: Artifactory
• Proxy function supported
• Instance at UOC (monaco):
– http://artifactory.uoc.es
• Access credentials: campus user
• Distinction between release and snapshot versions
• Use of UOC maven repository:
– Use:
• Add to pom.xml in the Repository section:
– http://artifactory.uoc.es/artifactory/repo
– Deploy:
• Add to pom.xml in the DistributionManagement the snapshot and release repos
– More information:
• http://cv.uoc.edu/~grc_8842_w01/guies/Uso_Repositorio_Maven_v1.2.pdf
Practices of Continuous Integration
• Maintain a single source repository.
• Automate the build (nightly builds)
• Make your build self-testing
• Everyone commits every day (at least!)
• Every commit should build the mainline on an integration machine
• Keep the build fast
• Test in a clone of the production environment
• Make it easy for anyone to get the latest executable
• Everyone can see what's happening
• Automate deployment (in UOC it could allow carry out the execution
of the whole workflow of an installation in PRO)
What is a Successful Build?
• When is your build successful?
– When it compiles
– When all the unit-tests have run
– When it has been deployed