SlideShare a Scribd company logo
1 of 13
Download to read offline
Hudson Continuous Integration Server
Author: Farrukh Jalil| Copyrights MAZARS Consulting Pakistan 1
White
Paper
Introduction
Hudson is a powerful and widely used open source continuous integration server providing
development teams with a reliable way to monitor changes in source control and trigger a variety of
builds. Hudson excels at integrating with almost every tool we can think of. Use Apache Maven, Apache
Ant (or anything we can start with a command line script) for builds, and send messages via email, SMS,
IRC, and Skype for notifications. In addition to providing a platform for continuous integration builds,
Hudson can also be extended to support software releases, documentation, monitoring, and a number
of use cases secondary to continuous integration.
With continuous integration, the system completes a build, test, deploy, and integration in response to
every single commit. If a developer in the web application group checks in code, Hudson kicks off a
build, runs unit tests, deploys the code to a new server, and performs a set of integration tests. If this
build fails or the tests encounter an unexpected condition, everyone is notified of this failure. With
continuous integration, no one needs to drop everything and run a release build, these builds are
generated every single day, and in the most mature environments, a fully tested and verified system can
be deployed to production at any time. In other words, when we automate build, test, and verify using a
tool like Hudson we can continue developing our applications without having to wait (or synchronize) on
some manual builds, test, and verify process. Making these processes automatic has another important
side-effect; it makes the development process more scalable. When our teams don’t have to stop to
actively test and collaborate with one another, it is much easier to add additional developers to a
project. Without continuous integration we have to stop and synchronize release schedules. With
continuous integration we can reduce the risk associated with a particular software development cycle.
Key Features of Hudson
The key features of Hudson are below
 Easy installation
 Easy configuration
 Web based interface
 Distributed Builds
 Unit test Reporting
 File Fingerprinting
 Build status Notification
 Extendable with plug-ins
Hudson Continuous Integration Server
Author: Farrukh Jalil| Copyrights MAZARS Consulting Pakistan 2
White
Paper
Products supported by Hudson CI Server
Hudson supports hundreds of standard products via plug-ins. To name a few
 SCM vendors: Git, CVS, SVN, Perforce, Mercurial, Team Foundation
 Build tools: Ant, maven, Gradle, MSBuild, Nant, Rake
 Unit Testing frameworks: JUnit, NUnit, Selenium, CppUnit, TestNg, XUnit
 Code Coverage tools: Clover, Cobertura, Emma, Serenity, Sonar, NCover, Jacoco
 Code Analysis Tools: Checkstyle, PMD, Dry, Findbugs, Warnings, CCM, Violations
 Security Tools: LDAP, Active Directory, Crowd, OpenID
 Applications servers: Weblogic, Glassfish, Tomcat, JBoss, IIS, JRebel
 Virtual Environment: EC2, Virtual Box, VmWare, JCloud
 Social communication: E-mail, IRC, Jabber, SMS, Twitter
Continuous Integration Stakeholders
Hudson Continuous Integration Server
Author: Farrukh Jalil| Copyrights MAZARS Consulting Pakistan 3
White
Paper
Steps for Hudson configuration and job creation
Below are the steps for Hudson installation and a build job example
Step 1: Install and configure Hudson CI Server
1. Download the latest hudson.war file from http://hudson-ci.org
2. Login Glassfish server admin console and deploy the hudson.war
Hudson Continuous Integration Server
Author: Farrukh Jalil| Copyrights MAZARS Consulting Pakistan 4
White
Paper
3. Open web browser for launching the Hudson CI Server using link (http://host-IP:port/hudson).
Hudson CI Server Initial Setup screen appears with different plug-ins, press the buttons “Install”
and “Finish” to complete Installation
INFO: “The required plug-ins can be installed during initial setup or user can install/update after
installation in Manage HudsonManage Plug-ins section.”
4. After completing installation, click “Manage Hudson” link on left menu for configuration
Hudson Continuous Integration Server
Author: Farrukh Jalil| Copyrights MAZARS Consulting Pakistan 5
White
Paper
5. In Manage Hudson, click the option “Mange Plug-ins” to install plug-ins
There are four tabs present in this option click the tab named “Available”.
In “Available” tab, click the option named “Recommended”, select above plug-ins and Press
“Install” button present on the page bottom.
The required plug-ins are;
a. Deploy to container plug-in (Artifact Uploaders Header)
b. Email-ext plug-in (Build Notifiers Header)
c. Backup plug-in (Utilities Header)
Hudson Continuous Integration Server
Author: Farrukh Jalil| Copyrights MAZARS Consulting Pakistan 6
White
Paper
6. Again, click on “Manage Hudson” link on right-side and go for the “Configure System” option
7. In “JDK Installation” section enter the JDK name and path of installation folder or click the
checkbox “install automatically”
8. In “Ant Section” type Ant name and ANT_HOME or click the checkbox “install automatically”
Hudson Continuous Integration Server
Author: Farrukh Jalil| Copyrights MAZARS Consulting Pakistan 7
White
Paper
9. In “Email Notification” section fill the SMTP configuration i.e. SMTP server, System Admin Email
Address, Hudson URL, User Name, Password, and SMTP Port. If configuration requires SMTP
authentication, click the checkbox “Use SMTP Authentication”
10. Press “Save” button to save configuration
Now, the Hudson configuration has been completed successfully. We are ready to create build if we
have ANT/Maven scripts for applications
Hudson Continuous Integration Server
Author: Farrukh Jalil| Copyrights MAZARS Consulting Pakistan 8
White
Paper
Step 2: Creating Ant scripts for application build
NetBeans maintains Ant script files for creating and deploying build file. These Ant scripts are required
to modify/change for working with Hudson CI Server. We can locate all Ant script files in nbproject
folder for update or modification.
1. Files hierarchy for calling Ant script in NetBeans is
build.xmlbuild-impl.xmlant-deploy.xml
2. Different properties files are used in above Ant scripts
including nbproject/project.properties,
nbproject/build.properties, and
nbproject/private/private.properties
3. For making independent build process we have to copy
all dependencies i.e. jar files, JDBC drivers and scripts to
a separate folder and modify the above properties files
with the path reference of that folder. (In our case all
dependencies are copied in “nblib” folder)
4. After copying all dependencies and references in
properties files, commit the newly created folder, Ant
scripts, and properties files in SVN repository.
Note: Make sure that folders named “dist” and “build”
should not be included in committed source in SVN.
There are different targets present in “build-impl.xml” file used to execute independent parallel tasks in
build process. We have a requirement to copy each war file in a separate backup folder after execution
of build process.
Note: The archive.dir, backup.war.name, and backup.war.extension will define in “project.properties”
file.
Hudson Continuous Integration Server
Author: Farrukh Jalil| Copyrights MAZARS Consulting Pakistan 9
White
Paper
Step 3: Creating job for build automation
1. On left-side menu click on the option “New Job” and enter Job name for application build. Select
“Build a free-style software job” and press the OK button
2. Newly created job will be display in main dashboard without any information or response i.e.
N/A. After creating new job we will configure it by clicking on job name
Hudson Continuous Integration Server
Author: Farrukh Jalil| Copyrights MAZARS Consulting Pakistan 10
White
Paper
3. On left-side menu, click on “Configure” option for add/modify configuration
4. In “Source Code Management” section, select “Subversion” and enter “Repository URL”, “Local
module directory” (Name of the folder where source check-out from SVN in workspace), and
“Checkout-out Strategy” (SVN update)
5. If there is a requirement for scheduled build, triggered on a specific time. We have to configure
“Build Triggers” section. Click on the checkbox “Build Periodically” and enter the schedule using
CRON expression
Hudson Continuous Integration Server
Author: Farrukh Jalil| Copyrights MAZARS Consulting Pakistan 11
White
Paper
6. If a build stuck, we can set timeout minutes with mark it as a fail build
7. Select Ant version in “Build” Section
8. In “Post-build Actions“section, select “Email Notification” and enter recipients email address.
9. For deploying application war file to a application server, we can select the option “Deploy
war/ear to a container”.
a) Enter relative path for created war file in distribution folder
b) Select App. Server from “Container” dropdown, in our case we select Glassfish 2.x
c) Enter admin User/Password
d) Enter complete path App. Server folder
e) Enter admin port for the application server, in our case the port will 4848
f) Enter Hostname/IP of the computer on which App. Server installed
Hudson Continuous Integration Server
Author: Farrukh Jalil| Copyrights MAZARS Consulting Pakistan 12
White
Paper
10. Select checkbox “Edit Email Notification” and enter email recipients with message detail. We
can add email triggers for build failure/success
11. Click “Save” button at the end to save the configuration
Now, we are ready to execute our build job by clicking the icon on right-side.
We can see the execution status on the bottom left of the screen.
Hudson Continuous Integration Server
Author: Farrukh Jalil| Copyrights MAZARS Consulting Pakistan 13
White
Paper
Popular Hudson Competitive Offerings
Apache Continuum — continuous integration server supporting Apache Maven and Apache Ant (open
source)
Bamboo — commercial continuous integration server by Atlassian Software Systems
CruiseControl — Java-based framework for a continuous builds process (open source)
TeamCity — commercial continuous-integration server by JetBrains
Team Foundation Server — commercial continuous integration server and source code repository by
Microsoft
Tinderbox — Mozilla-based product (open source)
Rational Team Concert — commercial software development collaboration platform by IBM
Further Reading
For more information read Hudson book available on http://www.eclipse.org/hudson/the-hudson-
book/book-hudson.html

More Related Content

What's hot

Devops interview questions 1 www.bigclasses.com
Devops interview questions  1  www.bigclasses.comDevops interview questions  1  www.bigclasses.com
Devops interview questions 1 www.bigclasses.combigclasses.com
 
Yama quick start english version
Yama quick start english versionYama quick start english version
Yama quick start english versionThe World Bank
 
MuleSoft Nashik Virtual Meetup#4 - Implementing CI/CD pipeline for deploying ...
MuleSoft Nashik Virtual Meetup#4 - Implementing CI/CD pipeline for deploying ...MuleSoft Nashik Virtual Meetup#4 - Implementing CI/CD pipeline for deploying ...
MuleSoft Nashik Virtual Meetup#4 - Implementing CI/CD pipeline for deploying ...Jitendra Bafna
 
Application Catalog and Approval Runbooks Sample
Application Catalog and Approval Runbooks SampleApplication Catalog and Approval Runbooks Sample
Application Catalog and Approval Runbooks SampleJames Donnelly
 
Enhance your Agility with DevOps
Enhance your Agility with DevOpsEnhance your Agility with DevOps
Enhance your Agility with DevOpsEdureka!
 
What's New in Helix VCS Fall Releases 2017
What's New in Helix VCS  Fall Releases 2017What's New in Helix VCS  Fall Releases 2017
What's New in Helix VCS Fall Releases 2017Perforce
 
Nagios Conference 2012 - Sam Lansing - Automating Windows Application Testing...
Nagios Conference 2012 - Sam Lansing - Automating Windows Application Testing...Nagios Conference 2012 - Sam Lansing - Automating Windows Application Testing...
Nagios Conference 2012 - Sam Lansing - Automating Windows Application Testing...Nagios
 
Oracle fusionmiddlewarecontinuosintegration slideshare_v1
Oracle fusionmiddlewarecontinuosintegration slideshare_v1Oracle fusionmiddlewarecontinuosintegration slideshare_v1
Oracle fusionmiddlewarecontinuosintegration slideshare_v1Rakesh Gujjarlapudi
 
JPQL/ JPA Activity 1
JPQL/ JPA Activity 1JPQL/ JPA Activity 1
JPQL/ JPA Activity 1SFI
 
Build using jenkins on rtc repository
Build using jenkins on rtc repositoryBuild using jenkins on rtc repository
Build using jenkins on rtc repositoryAnkit Vashistha
 
HP LoadRunner - What it is and How it works
HP LoadRunner - What it is and How it worksHP LoadRunner - What it is and How it works
HP LoadRunner - What it is and How it worksDhrumil Patel
 
Enterprise Cloud with IBM & Chef (ChefConf 2013)
Enterprise Cloud with IBM & Chef (ChefConf 2013)Enterprise Cloud with IBM & Chef (ChefConf 2013)
Enterprise Cloud with IBM & Chef (ChefConf 2013)Michael Elder
 
5 tsssisu sql_server_2012
5 tsssisu sql_server_20125 tsssisu sql_server_2012
5 tsssisu sql_server_2012Steve Xu
 
EMC Documentum xCP 2.0 Design Patterns
EMC Documentum xCP 2.0 Design PatternsEMC Documentum xCP 2.0 Design Patterns
EMC Documentum xCP 2.0 Design PatternsHaytham Ghandour
 
Xen mobile 8.5_migration_whitepaper
Xen mobile 8.5_migration_whitepaperXen mobile 8.5_migration_whitepaper
Xen mobile 8.5_migration_whitepaperNuno Alves
 
Kovair Omnibus Integrations – Why Are We Better - Product Literature
Kovair Omnibus Integrations – Why Are We Better - Product LiteratureKovair Omnibus Integrations – Why Are We Better - Product Literature
Kovair Omnibus Integrations – Why Are We Better - Product LiteratureKovair
 
.NET Application Modernization with PAS and Azure DevOps
.NET Application Modernization with PAS and Azure DevOps.NET Application Modernization with PAS and Azure DevOps
.NET Application Modernization with PAS and Azure DevOpsVMware Tanzu
 

What's hot (20)

Devops interview questions 1 www.bigclasses.com
Devops interview questions  1  www.bigclasses.comDevops interview questions  1  www.bigclasses.com
Devops interview questions 1 www.bigclasses.com
 
Salesforce CLI
Salesforce CLISalesforce CLI
Salesforce CLI
 
Yama quick start english version
Yama quick start english versionYama quick start english version
Yama quick start english version
 
MuleSoft Nashik Virtual Meetup#4 - Implementing CI/CD pipeline for deploying ...
MuleSoft Nashik Virtual Meetup#4 - Implementing CI/CD pipeline for deploying ...MuleSoft Nashik Virtual Meetup#4 - Implementing CI/CD pipeline for deploying ...
MuleSoft Nashik Virtual Meetup#4 - Implementing CI/CD pipeline for deploying ...
 
Application Catalog and Approval Runbooks Sample
Application Catalog and Approval Runbooks SampleApplication Catalog and Approval Runbooks Sample
Application Catalog and Approval Runbooks Sample
 
Enhance your Agility with DevOps
Enhance your Agility with DevOpsEnhance your Agility with DevOps
Enhance your Agility with DevOps
 
What's New in Helix VCS Fall Releases 2017
What's New in Helix VCS  Fall Releases 2017What's New in Helix VCS  Fall Releases 2017
What's New in Helix VCS Fall Releases 2017
 
Nagios Conference 2012 - Sam Lansing - Automating Windows Application Testing...
Nagios Conference 2012 - Sam Lansing - Automating Windows Application Testing...Nagios Conference 2012 - Sam Lansing - Automating Windows Application Testing...
Nagios Conference 2012 - Sam Lansing - Automating Windows Application Testing...
 
Oracle fusionmiddlewarecontinuosintegration slideshare_v1
Oracle fusionmiddlewarecontinuosintegration slideshare_v1Oracle fusionmiddlewarecontinuosintegration slideshare_v1
Oracle fusionmiddlewarecontinuosintegration slideshare_v1
 
xCP 2.1 Developer Guide
xCP 2.1 Developer GuidexCP 2.1 Developer Guide
xCP 2.1 Developer Guide
 
JPQL/ JPA Activity 1
JPQL/ JPA Activity 1JPQL/ JPA Activity 1
JPQL/ JPA Activity 1
 
Build using jenkins on rtc repository
Build using jenkins on rtc repositoryBuild using jenkins on rtc repository
Build using jenkins on rtc repository
 
HP LoadRunner - What it is and How it works
HP LoadRunner - What it is and How it worksHP LoadRunner - What it is and How it works
HP LoadRunner - What it is and How it works
 
Enterprise Cloud with IBM & Chef (ChefConf 2013)
Enterprise Cloud with IBM & Chef (ChefConf 2013)Enterprise Cloud with IBM & Chef (ChefConf 2013)
Enterprise Cloud with IBM & Chef (ChefConf 2013)
 
5 tsssisu sql_server_2012
5 tsssisu sql_server_20125 tsssisu sql_server_2012
5 tsssisu sql_server_2012
 
EMC Documentum xCP 2.0 Design Patterns
EMC Documentum xCP 2.0 Design PatternsEMC Documentum xCP 2.0 Design Patterns
EMC Documentum xCP 2.0 Design Patterns
 
Xen mobile 8.5_migration_whitepaper
Xen mobile 8.5_migration_whitepaperXen mobile 8.5_migration_whitepaper
Xen mobile 8.5_migration_whitepaper
 
MohitBilakhia
MohitBilakhiaMohitBilakhia
MohitBilakhia
 
Kovair Omnibus Integrations – Why Are We Better - Product Literature
Kovair Omnibus Integrations – Why Are We Better - Product LiteratureKovair Omnibus Integrations – Why Are We Better - Product Literature
Kovair Omnibus Integrations – Why Are We Better - Product Literature
 
.NET Application Modernization with PAS and Azure DevOps
.NET Application Modernization with PAS and Azure DevOps.NET Application Modernization with PAS and Azure DevOps
.NET Application Modernization with PAS and Azure DevOps
 

Viewers also liked

138.основы бизнеса
138.основы бизнеса138.основы бизнеса
138.основы бизнесаivanov156633595
 
59.приложение теории автоматов к перевозке нефти автотранспортом
59.приложение теории автоматов к перевозке нефти автотранспортом59.приложение теории автоматов к перевозке нефти автотранспортом
59.приложение теории автоматов к перевозке нефти автотранспортомivanov156633595
 
177.программа к учебно ознакомительной практике
177.программа к учебно ознакомительной практике177.программа к учебно ознакомительной практике
177.программа к учебно ознакомительной практикеivanov156633595
 
142.выявление повреждений роликоподшипника
142.выявление повреждений роликоподшипника142.выявление повреждений роликоподшипника
142.выявление повреждений роликоподшипникаivanov156633595
 
Brushless DC motor CIIT Abbottabad
Brushless DC motor CIIT AbbottabadBrushless DC motor CIIT Abbottabad
Brushless DC motor CIIT AbbottabadAhsan Raza
 

Viewers also liked (10)

138.основы бизнеса
138.основы бизнеса138.основы бизнеса
138.основы бизнеса
 
59.приложение теории автоматов к перевозке нефти автотранспортом
59.приложение теории автоматов к перевозке нефти автотранспортом59.приложение теории автоматов к перевозке нефти автотранспортом
59.приложение теории автоматов к перевозке нефти автотранспортом
 
177.программа к учебно ознакомительной практике
177.программа к учебно ознакомительной практике177.программа к учебно ознакомительной практике
177.программа к учебно ознакомительной практике
 
work pics
work picswork pics
work pics
 
142.выявление повреждений роликоподшипника
142.выявление повреждений роликоподшипника142.выявление повреждений роликоподшипника
142.выявление повреждений роликоподшипника
 
Uks technologies
Uks technologiesUks technologies
Uks technologies
 
Un río donde soltar lastre.
Un río donde soltar lastre. Un río donde soltar lastre.
Un río donde soltar lastre.
 
2.3.2. международный контракт
2.3.2. международный контракт2.3.2. международный контракт
2.3.2. международный контракт
 
Brushless DC motor CIIT Abbottabad
Brushless DC motor CIIT AbbottabadBrushless DC motor CIIT Abbottabad
Brushless DC motor CIIT Abbottabad
 
Vinay report
Vinay reportVinay report
Vinay report
 

Similar to Hudson_WhitePaper

Drupal Continuous Integration with Jenkins - Deploy
Drupal Continuous Integration with Jenkins - DeployDrupal Continuous Integration with Jenkins - Deploy
Drupal Continuous Integration with Jenkins - DeployJohn Smith
 
Ibm connections docs 2 install guide
Ibm connections docs 2 install guideIbm connections docs 2 install guide
Ibm connections docs 2 install guideRoberto Boccadoro
 
1 app 2 developers 3 servers
1 app 2 developers 3 servers1 app 2 developers 3 servers
1 app 2 developers 3 serversMark Myers
 
Integrate UFT with Jenkins Guide
Integrate UFT with Jenkins GuideIntegrate UFT with Jenkins Guide
Integrate UFT with Jenkins GuideYu Tao Zhang
 
Containers Lab
Containers Lab Containers Lab
Containers Lab Dev_Events
 
Setting up the hyperledger composer in ubuntu
Setting up the hyperledger composer in ubuntuSetting up the hyperledger composer in ubuntu
Setting up the hyperledger composer in ubuntukesavan N B
 
Deployingmuleapplications 160903085602
Deployingmuleapplications 160903085602Deployingmuleapplications 160903085602
Deployingmuleapplications 160903085602ppts123456
 
ESM 6.9.1c Patch1 Release Notes
	ESM 6.9.1c Patch1 Release Notes 	ESM 6.9.1c Patch1 Release Notes
ESM 6.9.1c Patch1 Release Notes Protect724tk
 
Prizm Installation Guide
Prizm Installation GuidePrizm Installation Guide
Prizm Installation Guidevjvarenya
 
Sharing Resources - Mule
Sharing Resources - MuleSharing Resources - Mule
Sharing Resources - MuleAnil Kumar V
 
Deploying mule applications
Deploying mule applicationsDeploying mule applications
Deploying mule applicationsBhargav Ranjit
 
Windows Azure(Pr-1).ppt.pptx
Windows Azure(Pr-1).ppt.pptxWindows Azure(Pr-1).ppt.pptx
Windows Azure(Pr-1).ppt.pptxPrincePatel272012
 
varun JENKINS.pptx
varun JENKINS.pptxvarun JENKINS.pptx
varun JENKINS.pptxVgPolampalli
 
Introduction to Bluemix and Watson
Introduction to Bluemix and WatsonIntroduction to Bluemix and Watson
Introduction to Bluemix and WatsonJake Peyser
 
Jbossworld Presentation
Jbossworld PresentationJbossworld Presentation
Jbossworld PresentationDan Hinojosa
 
APACHE
APACHEAPACHE
APACHEARJUN
 

Similar to Hudson_WhitePaper (20)

Drupal Continuous Integration with Jenkins - Deploy
Drupal Continuous Integration with Jenkins - DeployDrupal Continuous Integration with Jenkins - Deploy
Drupal Continuous Integration with Jenkins - Deploy
 
Ibm connections docs 2 install guide
Ibm connections docs 2 install guideIbm connections docs 2 install guide
Ibm connections docs 2 install guide
 
1 app 2 developers 3 servers
1 app 2 developers 3 servers1 app 2 developers 3 servers
1 app 2 developers 3 servers
 
Integrate UFT with Jenkins Guide
Integrate UFT with Jenkins GuideIntegrate UFT with Jenkins Guide
Integrate UFT with Jenkins Guide
 
Containers Lab
Containers Lab Containers Lab
Containers Lab
 
Setting up the hyperledger composer in ubuntu
Setting up the hyperledger composer in ubuntuSetting up the hyperledger composer in ubuntu
Setting up the hyperledger composer in ubuntu
 
Deployingmuleapplications 160903085602
Deployingmuleapplications 160903085602Deployingmuleapplications 160903085602
Deployingmuleapplications 160903085602
 
Twelve factor apps
Twelve factor appsTwelve factor apps
Twelve factor apps
 
ESM 6.9.1c Patch1 Release Notes
	ESM 6.9.1c Patch1 Release Notes 	ESM 6.9.1c Patch1 Release Notes
ESM 6.9.1c Patch1 Release Notes
 
Prizm Installation Guide
Prizm Installation GuidePrizm Installation Guide
Prizm Installation Guide
 
Microsoft Lync Server 2010 Installation
Microsoft Lync Server 2010 InstallationMicrosoft Lync Server 2010 Installation
Microsoft Lync Server 2010 Installation
 
Sharing Resources - Mule
Sharing Resources - MuleSharing Resources - Mule
Sharing Resources - Mule
 
Deploying mule applications
Deploying mule applicationsDeploying mule applications
Deploying mule applications
 
Writing first-hudson-plugin
Writing first-hudson-pluginWriting first-hudson-plugin
Writing first-hudson-plugin
 
Windows Azure(Pr-1).ppt.pptx
Windows Azure(Pr-1).ppt.pptxWindows Azure(Pr-1).ppt.pptx
Windows Azure(Pr-1).ppt.pptx
 
Build server
Build serverBuild server
Build server
 
varun JENKINS.pptx
varun JENKINS.pptxvarun JENKINS.pptx
varun JENKINS.pptx
 
Introduction to Bluemix and Watson
Introduction to Bluemix and WatsonIntroduction to Bluemix and Watson
Introduction to Bluemix and Watson
 
Jbossworld Presentation
Jbossworld PresentationJbossworld Presentation
Jbossworld Presentation
 
APACHE
APACHEAPACHE
APACHE
 

Hudson_WhitePaper

  • 1. Hudson Continuous Integration Server Author: Farrukh Jalil| Copyrights MAZARS Consulting Pakistan 1 White Paper Introduction Hudson is a powerful and widely used open source continuous integration server providing development teams with a reliable way to monitor changes in source control and trigger a variety of builds. Hudson excels at integrating with almost every tool we can think of. Use Apache Maven, Apache Ant (or anything we can start with a command line script) for builds, and send messages via email, SMS, IRC, and Skype for notifications. In addition to providing a platform for continuous integration builds, Hudson can also be extended to support software releases, documentation, monitoring, and a number of use cases secondary to continuous integration. With continuous integration, the system completes a build, test, deploy, and integration in response to every single commit. If a developer in the web application group checks in code, Hudson kicks off a build, runs unit tests, deploys the code to a new server, and performs a set of integration tests. If this build fails or the tests encounter an unexpected condition, everyone is notified of this failure. With continuous integration, no one needs to drop everything and run a release build, these builds are generated every single day, and in the most mature environments, a fully tested and verified system can be deployed to production at any time. In other words, when we automate build, test, and verify using a tool like Hudson we can continue developing our applications without having to wait (or synchronize) on some manual builds, test, and verify process. Making these processes automatic has another important side-effect; it makes the development process more scalable. When our teams don’t have to stop to actively test and collaborate with one another, it is much easier to add additional developers to a project. Without continuous integration we have to stop and synchronize release schedules. With continuous integration we can reduce the risk associated with a particular software development cycle. Key Features of Hudson The key features of Hudson are below  Easy installation  Easy configuration  Web based interface  Distributed Builds  Unit test Reporting  File Fingerprinting  Build status Notification  Extendable with plug-ins
  • 2. Hudson Continuous Integration Server Author: Farrukh Jalil| Copyrights MAZARS Consulting Pakistan 2 White Paper Products supported by Hudson CI Server Hudson supports hundreds of standard products via plug-ins. To name a few  SCM vendors: Git, CVS, SVN, Perforce, Mercurial, Team Foundation  Build tools: Ant, maven, Gradle, MSBuild, Nant, Rake  Unit Testing frameworks: JUnit, NUnit, Selenium, CppUnit, TestNg, XUnit  Code Coverage tools: Clover, Cobertura, Emma, Serenity, Sonar, NCover, Jacoco  Code Analysis Tools: Checkstyle, PMD, Dry, Findbugs, Warnings, CCM, Violations  Security Tools: LDAP, Active Directory, Crowd, OpenID  Applications servers: Weblogic, Glassfish, Tomcat, JBoss, IIS, JRebel  Virtual Environment: EC2, Virtual Box, VmWare, JCloud  Social communication: E-mail, IRC, Jabber, SMS, Twitter Continuous Integration Stakeholders
  • 3. Hudson Continuous Integration Server Author: Farrukh Jalil| Copyrights MAZARS Consulting Pakistan 3 White Paper Steps for Hudson configuration and job creation Below are the steps for Hudson installation and a build job example Step 1: Install and configure Hudson CI Server 1. Download the latest hudson.war file from http://hudson-ci.org 2. Login Glassfish server admin console and deploy the hudson.war
  • 4. Hudson Continuous Integration Server Author: Farrukh Jalil| Copyrights MAZARS Consulting Pakistan 4 White Paper 3. Open web browser for launching the Hudson CI Server using link (http://host-IP:port/hudson). Hudson CI Server Initial Setup screen appears with different plug-ins, press the buttons “Install” and “Finish” to complete Installation INFO: “The required plug-ins can be installed during initial setup or user can install/update after installation in Manage HudsonManage Plug-ins section.” 4. After completing installation, click “Manage Hudson” link on left menu for configuration
  • 5. Hudson Continuous Integration Server Author: Farrukh Jalil| Copyrights MAZARS Consulting Pakistan 5 White Paper 5. In Manage Hudson, click the option “Mange Plug-ins” to install plug-ins There are four tabs present in this option click the tab named “Available”. In “Available” tab, click the option named “Recommended”, select above plug-ins and Press “Install” button present on the page bottom. The required plug-ins are; a. Deploy to container plug-in (Artifact Uploaders Header) b. Email-ext plug-in (Build Notifiers Header) c. Backup plug-in (Utilities Header)
  • 6. Hudson Continuous Integration Server Author: Farrukh Jalil| Copyrights MAZARS Consulting Pakistan 6 White Paper 6. Again, click on “Manage Hudson” link on right-side and go for the “Configure System” option 7. In “JDK Installation” section enter the JDK name and path of installation folder or click the checkbox “install automatically” 8. In “Ant Section” type Ant name and ANT_HOME or click the checkbox “install automatically”
  • 7. Hudson Continuous Integration Server Author: Farrukh Jalil| Copyrights MAZARS Consulting Pakistan 7 White Paper 9. In “Email Notification” section fill the SMTP configuration i.e. SMTP server, System Admin Email Address, Hudson URL, User Name, Password, and SMTP Port. If configuration requires SMTP authentication, click the checkbox “Use SMTP Authentication” 10. Press “Save” button to save configuration Now, the Hudson configuration has been completed successfully. We are ready to create build if we have ANT/Maven scripts for applications
  • 8. Hudson Continuous Integration Server Author: Farrukh Jalil| Copyrights MAZARS Consulting Pakistan 8 White Paper Step 2: Creating Ant scripts for application build NetBeans maintains Ant script files for creating and deploying build file. These Ant scripts are required to modify/change for working with Hudson CI Server. We can locate all Ant script files in nbproject folder for update or modification. 1. Files hierarchy for calling Ant script in NetBeans is build.xmlbuild-impl.xmlant-deploy.xml 2. Different properties files are used in above Ant scripts including nbproject/project.properties, nbproject/build.properties, and nbproject/private/private.properties 3. For making independent build process we have to copy all dependencies i.e. jar files, JDBC drivers and scripts to a separate folder and modify the above properties files with the path reference of that folder. (In our case all dependencies are copied in “nblib” folder) 4. After copying all dependencies and references in properties files, commit the newly created folder, Ant scripts, and properties files in SVN repository. Note: Make sure that folders named “dist” and “build” should not be included in committed source in SVN. There are different targets present in “build-impl.xml” file used to execute independent parallel tasks in build process. We have a requirement to copy each war file in a separate backup folder after execution of build process. Note: The archive.dir, backup.war.name, and backup.war.extension will define in “project.properties” file.
  • 9. Hudson Continuous Integration Server Author: Farrukh Jalil| Copyrights MAZARS Consulting Pakistan 9 White Paper Step 3: Creating job for build automation 1. On left-side menu click on the option “New Job” and enter Job name for application build. Select “Build a free-style software job” and press the OK button 2. Newly created job will be display in main dashboard without any information or response i.e. N/A. After creating new job we will configure it by clicking on job name
  • 10. Hudson Continuous Integration Server Author: Farrukh Jalil| Copyrights MAZARS Consulting Pakistan 10 White Paper 3. On left-side menu, click on “Configure” option for add/modify configuration 4. In “Source Code Management” section, select “Subversion” and enter “Repository URL”, “Local module directory” (Name of the folder where source check-out from SVN in workspace), and “Checkout-out Strategy” (SVN update) 5. If there is a requirement for scheduled build, triggered on a specific time. We have to configure “Build Triggers” section. Click on the checkbox “Build Periodically” and enter the schedule using CRON expression
  • 11. Hudson Continuous Integration Server Author: Farrukh Jalil| Copyrights MAZARS Consulting Pakistan 11 White Paper 6. If a build stuck, we can set timeout minutes with mark it as a fail build 7. Select Ant version in “Build” Section 8. In “Post-build Actions“section, select “Email Notification” and enter recipients email address. 9. For deploying application war file to a application server, we can select the option “Deploy war/ear to a container”. a) Enter relative path for created war file in distribution folder b) Select App. Server from “Container” dropdown, in our case we select Glassfish 2.x c) Enter admin User/Password d) Enter complete path App. Server folder e) Enter admin port for the application server, in our case the port will 4848 f) Enter Hostname/IP of the computer on which App. Server installed
  • 12. Hudson Continuous Integration Server Author: Farrukh Jalil| Copyrights MAZARS Consulting Pakistan 12 White Paper 10. Select checkbox “Edit Email Notification” and enter email recipients with message detail. We can add email triggers for build failure/success 11. Click “Save” button at the end to save the configuration Now, we are ready to execute our build job by clicking the icon on right-side. We can see the execution status on the bottom left of the screen.
  • 13. Hudson Continuous Integration Server Author: Farrukh Jalil| Copyrights MAZARS Consulting Pakistan 13 White Paper Popular Hudson Competitive Offerings Apache Continuum — continuous integration server supporting Apache Maven and Apache Ant (open source) Bamboo — commercial continuous integration server by Atlassian Software Systems CruiseControl — Java-based framework for a continuous builds process (open source) TeamCity — commercial continuous-integration server by JetBrains Team Foundation Server — commercial continuous integration server and source code repository by Microsoft Tinderbox — Mozilla-based product (open source) Rational Team Concert — commercial software development collaboration platform by IBM Further Reading For more information read Hudson book available on http://www.eclipse.org/hudson/the-hudson- book/book-hudson.html