Вы находитесь на странице: 1из 13

Continuous integration

Continuous Integration (CI) is a process


in which whenever a developer performs
code check-in shared repository, the
whole project is automatically build and
tested, in order to find Integration
issues.

CI reveals integration issues at a very


early stage.
How CI works

Remo
te
Repo Compil
e

Unit
Local Test
Repositor cases
y

CI Regressio
Serve n Test
r cases

Publish
reports
Benefits of CI

1. Continuously integrates the whole


project, thereby eliminating the
Integration phase.
2. Catches Issues at very early stage.
3. Reduces time for de-bugging, as
issues are caught at each
integration.

4. Help to deliver the product more


Famous tools
for CI
The famous tools for CI are :
1. Jenkins
2. Hudson
3. Team city
4. Team foundation server

In above Jenkins and Hudson are free


CI tools.
Jenkins

Jenkins is a open-source Continuous


tool/server, which is used to automatically
build the whole project whenever needed
Jenkins is originally created as Hudson,
but after dispute with Oracle, this project
is separated by open source community
as Jenkins.
Installing and running
Jenkins
Use following steps to install and run
Jenkins on local environment :
1. Go to http://jenkins-ci.org/ and
download Jenkins server in .war format.
2. Open CMD and run following command
to start the server :
java jar jenkins.war
3. By default Jenkins runs on 8080 port,
so open a browser and hit URL as
http://localhost:8080
Opening Jenkins in
Browser
As Jenkins also comes as Java Web
Archive, it can be run as a Web
application, by running the Jenkins
Servlet container.
Jenkins uses all other tools of the
same server and make them to work
together to automate the build
process.
But before any build process, we
need to configure the Jenkins!!!!
Configuring Jenkins
Plug-ins
More than 600 plug-ins are available to
customize Jenkins as per project requirements.
To Manage Jenkins plug-ins use following steps:
1. Open Jenkins in browser
2. Click on Manage Jenkins
3. Click on Manage Plug-ins.

4. Go to Available Plug-ins and choose the


plug-in you need.!!!
Jenkins Configuration
Wizard
In order to connect Jenkins with other tools (i.e java,
maven etc.) first we need to configure the Jenkins.
Use following steps to configure Jenkins:
1. Open Jenkins in any browser.
2. Click on Manage Jenkins
3. Click on Configure System
4. Now configure following :
. Java :
a) Set the path of Java_Home variable as of
System variable. (e.g. C:\Program
Files\Java\jdk1.6.0_17)
Jenkins Configuration Wizard - continued

Git :
a) Set the path of Git installation directory
(e.g. C:\Program Files\Git\bin\git.exe)
Maven:
a) Set the path of Maven installation
directory as of Maven_Home variable
( e.g. E:\maven2\apache-maven-3.0.5-
bin\apache-maven-3.0.5)
5. Now save the above settings.
Jenkins Build Jobs
Build Job is nothing but a particular
step in build process.
A single project can have a number
of build jobs.
For example : compiling and running
the source code a single build job
and running a integration test is
another build job.
Creating Build Jobs
In order to create a build job use following
steps:
1. Open Jenkins
2. Click on new Job
3. Give a Job name and select build a free
style software product and click on OK
4. A Project configuration screen will appear.
5. In Source code management select Git
(because our source code is in Git-hub).
6. Now give the git hub source code URL.
Creating Build Jobs -
continued
7. In Build trigger section we need to tell Jenkins that at
what time we want to trigger the building process.
> Select Pol SCM
> Enter @hourly in Schedule section which means we
want to trigger the build process at every hour.
8. In Build Section we have to specify in which way we
want to do the build process, since we want to use
Maven, therefore select Invoke top level Maven
targets
9. In Maven version give the version of Maven you are
using.
10. Set the Goal section of Maven as
clean package

Вам также может понравиться