240 likes | 865 Views
Agenda. Why Integration?What is Continuous Integration?Continuous Integration ProcessCI InfrastructureCI Tool: HudsonDemo in UOC Hudson: CampusGateway. Integration. Modularizationenables team developmentmakes complex systems manageableIntegrated Modules do successfullyCompileRunPass test.
E N D
1. Continuous Integration (CI) with Hudson
Carlos Ors (corsg@uoc.edu)
Antoni Bertran (abertranb@uoc.edu)
December 2010
2. Agenda Why Integration?
What is Continuous Integration?
Continuous Integration Process
CI Infrastructure
CI Tool: Hudson
Demo in UOC Hudson: CampusGateway
3. Integration Modularization
enables team development
makes complex systems manageable
Integrated Modules do successfully
Compile
Run
Pass test
4. Integration Challenges
5. 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
6. Manual Integration Integration becomes expensive
if made manual (build, test, deployment, )
with too few checkins (hours or days)
If integration problems and bugs are detected too late
Reduces desire to refactor
7. Continuous Integration: definitions
8. 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
9. 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
10. Continuous Integration Infrastructure
11. 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
12. 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)
13. 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!
14. 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
15. A CI Tool: Hudson
16. 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
17. Hudson Build Status
18. Hudson Components CI Server
Monitors the SCM
Executes the build script
Management Console (plug-in area)
Dashboard
Build report viewer
19. 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
20. 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
21. 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
22. 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
23. Resources Martin Fowler about CI
http://www.martinfowler.com/articles/continuousIntegration.html
Wiki
http://c2.com/cgi/wiki?ContinuousIntegration