0% found this document useful (0 votes)
77 views24 pages

Continuous Integration With Hudson1

Continuous integration (CI) involves automatically rebuilding a system every time code changes are committed and running automated tests to identify integration errors early. Hudson is an open-source CI server that monitors source code repositories for changes, rebuilds the system, and runs tests on every commit. It provides a dashboard and notifications to help developers quickly identify and address broken builds. The document discusses CI concepts and principles, the Hudson CI tool, and how CI is implemented at UOC using Hudson.

Uploaded by

Abhishek
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
77 views24 pages

Continuous Integration With Hudson1

Continuous integration (CI) involves automatically rebuilding a system every time code changes are committed and running automated tests to identify integration errors early. Hudson is an open-source CI server that monitors source code repositories for changes, rebuilds the system, and runs tests on every commit. It provides a dashboard and notifications to help developers quickly identify and address broken builds. The document discusses CI concepts and principles, the Hudson CI tool, and how CI is implemented at UOC using Hudson.

Uploaded by

Abhishek
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 24

Continuous Integration (CI)

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

• Integration server monitors source repository


– Rebuilds with every change
– Runs all unit and acceptance tests
– Publishes build results
– Notifies developers if build breaks
– Labels successful builds in source repository
Continuous Integration Prerequisites
• Tools needed
– VCS server
– Build server
– Deployment Server
– Automation tools
– CI tools

• 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

• In fact, every failure is a success


– You have exposed a potential problem – early!
Benefits

• Always be aware of current status of the project


• Less time spent investigating integration bugs
• Less time wasted because of broken code in version
control system
• Prove your system can build!
• Increase code quality with additional tasks
• Discover potential deployment issues
A CI Tool: Hudson
Monitoring
• Hudson
– Continuous Integration Server
– Integrates building, unit tests, code coverage,analysis
– Provides the ability to hook in almost any output.
– Gives instant knowledge of status of builds.
– Provides dashboard like integration for multiple
projects
– Hudson UOC instance:
• http://hudson.uoc.es
• Credentials: campus user
Hudson Build Status
Hudson Components
• CI Server
– Monitors the SCM
– Executes the build script
• Management Console (plug-in area)
• Dashboard
– Build report viewer
Hudson Add-ons
• Many build in Plugins
(http://wiki.hudson-ci.org/display/HUDSON/Plugins)

– Test Code Coverage


– Analysis
– Unit testing
– Doxygen
– Ant
– Google Calendar
– Dependency Management with IVY
– …
Useful Hudson Plugins
• Jboss management plugin
• Ruby plugin
• SSH plugin
• VMware plugin
• Android emulator plugin
• Zen Timestamp plugin
• Mask Passwords plugin
• Twitter plugin
• JUnit Attachment plugin
• Selenium AES plugin
• JSUnit plugin
• Log Parser plugin
• Performance plugin (Jmeter)
• HTML Publisher plugin
• JIRA plugin
• Hudson Personal View plugin
• Subversion Release Manager plugin
• M2 release plugin
Other Popular CI Tools
• Cruise Control (OS)
– http://cruisecontrol.sourceforge.net/
• Anthill Pro (Com)
– http://www.anthillpro.com/
• Continuum (OS)
– http://maven.apache.org/continuum/
• Pulse (Com)
– http://www.zutubi.com/
• Luntbuild (OS)
– http://luntbuild.javaforge.com/
• ParaBuild Server (Com)
– http://www.viewtier.com/index.htm
Summary
• Continually integrate and test to reduce risk
• Detect problems early
• Always have a deployable build
• Generate metrics to guide project management
• Continuous Integration is:
– Vital for successful software development
Resources
• Martin Fowler about CI
– http://www.martinfowler.com/articles/continuo
usIntegration.html
• Wiki
– http://c2.com/cgi/wiki?ContinuousIntegration

You might also like