Continuous Integration Ain't What it Used to Be (With Jenkins, It's EASIER)
Join the DZone community and get the full member experience.Join For Free
in a previous article, entitled, continuous integration: how to avoid 'integration hell' , we discussed the general issues and considerations of the continuous integration environment and projects. in this article, we will discuss jenkins (previously known as hudson), which is one of the most popular continuous integration (ci) tools, and how you can achieve continuous integration using this tool.
the jenkins tool is an open source continuous integration tool which is written in java, and runs in a servlet container like apache tomcat. it can be used to build software written in various languages such as java, .net, php, c++ etc. this open-source, free software is available under mit license.
jenkins features include:
- building/testing software projects continuously - you can create build jobs in jenkins. there are various configuration options available related to building the software, e.g. code repository, build scheduling, executing test scripts, generating reports etc.
- monitoring the execution of repeated jobs -jenkins monitors and logs the information related to the execution of repeated build jobs. it maintains the build history with time and status information. users can also see the console log for particular build instance.
- scm integration, e.g., svn, git etc . - jenkins integrates with wide range of popular scm tools such as git, cvs, svn, perforce, mercurial, team foundation etc.
- rss/e-mail/im integration - there are various options available to notify the team members about successful or failed builds.
- junit/testng test reporting - test reports can be tabulated, summarized, and displayed with history information. history trends are plotted in a graph.
- distributed builds - it is possible to distribute the load of preparing builds across multiple workstations.
- authorization - jenkins can be configured to have role-based access for the build jobs. this is helpful for big organizations where the same ci server is used to build multiple projects by different teams.
- plug-in support - various plug-ins are available and jenkins can be integrated with well-known development tools so developers can write plug-ins to suit the unique requirement of the team.
jenkins supports following tools in different categories:
git, cvs, svn, perforce, mercurial, team foundation and many more.
- build tools: ant, maven, gradle, msbuild, nant, rake and many more.
- unit testing frameworks: junit, nunit, selenium, cppncss , testng, xunit and many more.
- code coverage tools: clover, cobertura, emma, serenity, sonar, ncover and many more.
- code analysis tools: checkstyle, pmd, dry, findbugs, warnings, ccm, violations and many more.
- security tools: ldap, active directory, crowd and many more.
- applications servers: weblogic, glassfish, tomcat, jboss etc.
- virtual environment: ec2, virtual box, vmware, jcloud etc.
- social communication: e-mail, irc, jabber, twitter etc.
to integrate particular tools with jenkins, you need to install relevant plug-ins from the plug-in manager, as part of the configuration. once the initial set of plug-ins is established, it is also possible to install new plug-ins later as required.
figure 1 : the jenkins dashboard shows the list of jobs with various options such as execute job, view console, build health etc.
figure 2 : from the plug-in manager you can find available plug-ins, check updates and see installed plug-ins.
figure 3 : from here you can create new a build job, and provide a meaningful name to the job, based on the project. you can configure the code repository and provide parameters related to other build options.
: as part of configuring
build job, you can also configure the tool to send email notifications to
different people to notify them of various events, and link the deployment
server to deploy the build after successful completion, as well as other
figure 5 : in this view, you can see the console output with information related to the execution of the build, test scripts, deployment etc.
figure 6 : this is a sample email sent from jenkins to the developer who broke the build, along with information related to the svn code file updates.
figure 7 : jenkins shows the build history with the information such as build status, time of build and console log.
other jenkins plug-ins
there are over 150 plug-ins in this tool, including:
- artifact uploaders
- build notifiers
- build reports
- build tools
- build triggers
- build wrappers
- cluster management
other popular continuous integration (ci) tools
- apache continuum - continuous integration server supporting apache maven and apache ant
- cruisecontrol - java based framework
- tinderbox - mozilla-based product
- bamboo - by atlassian software systems
- teamcity - by jetbrains
- team foundation - server by microsoft
- rational team concert by - ibm
jenkins and other continuous integration (ci) can be used to automate the process of code integration, making the build and release management easier, faster and more reliable. these tools make the development process smooth, reduce code errors, increase the productivity of the developers and optimize the deployment and delivery of the software solution .
hasan sunasara : who loves to design, develop and tune java enterpriseapplications . i strive to learn new things and improve on every possible areas touched by on the path of life. when not working on java, i socialize, read blogs and watch movies.
Opinions expressed by DZone contributors are their own.