ou
       u n
Let’s start
     in io
    t t    s
   n a
  o r with
C g
 Inte Jenkins
What’s
 Continuous
   Integration?
Organize
Current problems
Lots of bugs are found at the end of test phase
As the system size increases, load of test gets
bigger
Frequently degraded when merge
Hard to merge manually
Unexpected recognition differences of
requirements
Lots of bugs are found at the end of test phase
As the system size increases, load of test gets
bigger
Frequently degraded when merge
Hard to merge manually
Unexpected recognition differences of
requirements
Lots of bugs are found at the end of test phase
As the system size increases, load of test gets
bigger
Frequently degraded when merge
Hard to merge manually
Unexpected recognition differences of
requirements
Lots of bugs are found at the end of test phase
As the system size increases, load of test gets
bigger
Frequently degraded when merge
Hard to merge manually
Unexpected recognition differences of
requirements
Lots of bugs are found at the end of test phase
As the system size increases, load of test gets
bigger
Frequently degraded when merge
Hard to merge manually
Unexpected recognition differences of
requirements
W   e d o n’t
a n y m o re !!
Purp
    ose
Improve
 quality
Decrease
frustration
Reduce the
communication gap
with early feedback
Continuous integration Continuous integration
Continuous integration Continuous integration
Continuous integration Continuous integration
Continuous integration Continuous integration
Continuous integration Continuous integration
 What
     isContinuous integration?
Continuous integration Continuous integration
Continuous integration Continuous integration
Continuous integration Continuous integration
Continuous integration Continuous integration
Continuous integration Continuous integration
CI
 is the “practice”
     but not a “tool”.
Process of CI
Build server   CI server        Repository

                           Monitor
Process of CI
Build server   CI server        Repository
                           Detect

                           Commit
Process of CI
Build server       CI server   Repository

           Build
Process of CI
Build server   CI server       Repository


                      Report
CI is composed of:
connection to repository
build script
feedback means such as mail
process of integrating source code modification
(test, inspection, deployment and feedback)
CI is composed of:
connection to repository
build script
feedback means such as mail
process of integrating source code modification
(test, inspection, deployment and feedback)
CI is composed of:
connection to repository
build script
feedback means such as mail
process of integrating source code modification
(test, inspection, deployment and feedback)
CI is composed of:
connection to repository
build script
feedback means such as mail
process of integrating source code modification
(test, inspection, deployment and feedback)
"Build" in CI means
a series of processes
rather than
the so-called compilation
that is executed
at the time of committing
Merit
Reduce risk
Reduce routine
Ensure the source code
  that can be deployed
Visualize
project
To be confident
for
products
Demerit
Load to build CI system
 -> initial cost
Hardware cost for CI system
 -> initial + running cost
Maintenance of CI system
 -> running cost
Frequent build error
 -> running cost
Question
Do you leave the problem you're having
now without any action?
How much cost have we taken
due to the problems that has occurred?
Act
What’s
Jenkins?
Merit
1. Easy GUI
2. Easy to install
3. Lots of plugins
4. Leave execution logs
Demerit
1. Frequent update
2. Difficult to understand
words for Jenkins
First of all


Install
CentOS
https://wiki.jenkins-ci.org/display/JENKINS/Installing
+Jenkins+on+RedHat+distributions
Download & install Jenkins
sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-
ci.org/redhat/jenkins.repo

sudo rpm --import http://pkg.jenkins-ci.org/redhat/jenkins-
ci.org.key

sudo yum install jenkins
Check java installation
java -version
Start
sudo service jenkins start
Access
http://hostname:8080
What can we do
          with
      Jenkins?
Realize CI environment
Customization
familiar
to our environment
Pra
Inspection


              ctic
              Plugin Plugin Plugin
Joined test   scrum scrum scrum
Unit test         agile agile agile
Deploy



                  e
               Redmine
               cakePHP
               Github
               git
Overview
of general system structure
 that we’ve ever developed
Mainly
web application
cakePHP
Whole structure
   "aiming for the time being"
           with using Jenkins
Whole structure
                                    Review
Build     Repository


                 Merge
Build
                     Pull request
              Detect
Whole structure
Build           Repository

                             Push
        Build                Detect
Mus
   t
Check inspection when committing
Run all unit test script and kick operation test
tool when committing
Coverage is reported as a result of test after
automated test
Build error is sent to developers automatically
Run all unit test script regularly
Inspection
coverage: Clover PHP Plugin
https://wiki.jenkins-ci.org/display/JENKINS/Clover+PHP+Plugin


coding convention: Checkstyle Plugin
https://wiki.jenkins-ci.org/display/JENKINS/Checkstyle+Plugin


duplicate code: DRY Plugin
https://wiki.jenkins-ci.org/display/JENKINS/DRY+Plugin


conplicated: PMD Plugin
https://wiki.jenkins-ci.org/display/JENKINS/PMD+Plugin
Unit test
Use PHPunit
Use bake
import test result in XML format that is
compatible with jUnit
xUnit Plugin
https://wiki.jenkins-ci.org/display/JENKINS/xUnit+Plugin
Register script to run 'AllTests'
./_lib/app/Console/cake test 
-log-junit=./reports/unittest.xml 
-coverage-html=./reports/coverage_html 
-coverage-clover=./reports/coverage.xml 
app AllTests
This prevents degrading
But “TDD” is required.
Operation test
Use Selenium
Do operation test with using Selenium manually first.
Use Selenium RC
to write test cases using PHPunit
it enables us to connect Selenium with Jenkins
Import test result in HTML format
seleniumhtmlreport Plugin
https://wiki.jenkins-ci.org/display/JENKINS/seleniumhtmlreport+Plugin
Wan
    t
Deploy automatically on test server
after passing unit test
Check differences of commit on browser
Synchronize commit and ticket on redmine
Build test server automatically
when dividing branches
Nee
   d?
Create documents automatically

Documents are not only for maintenance but
also one of the most important method to
share recognition between producer and
developer in offshore development.
In
summary
CI help us realize early feedback.
CI help us realize early feedback.

Early feedback enable us to find
bugs at the beginning of test
phase and decrease communication
gap.
CI help us realize early feedback.
Early feedback enable us to find bugs at the beginning of test phase
and decrease communication gap.

Automated test enable to decrease
degrade and load for test.
CI help us realize early feedback.
Early feedback enable us to find bugs at the beginning of test phase
and decrease communication gap.
Automated test enable to decrease degrade and load for test.

Jenkins provide us for comfortable
CI environment.
Thank you!!

Let’s start Continuous Integration with jenkins