Continuous Integration ( CI )

www.pentalog.fr
Contents
What’s CI?
How does it work?
Why use it?
Bamboo
How we use it

October 2013

pentalog.fr

2
What’s CI?
Concept, not application
The practice of merging all dev working copies with a shared mainline
Main goal : prevent integration problems

Requires no particular tooling to deploy, though a CI server is useful

October 2013

pentalog.fr

3
How does it work?

October 2013

pentalog.fr

4
Why use it?
Reverting to a bug-free state in case of build failures
Avoid last minute chaos at release dates
Immediate unit and integration testing of all changes
Limit the risk of regression
Immediate feedback to developers on the quality, functionality, or
system-wide impact of code they are writing
Metrics generated from automated testing and CI focus developers on
developing functional, quality code
October 2013

pentalog.fr

5
GIT Branching

master
project

user 1
user 2

Commit

Build OK

Launch unit tests

Build KO

October 2013

pentalog.fr

6
Bamboo
CI server
automated building and testing of software source-code
updates on successful/failed builds
reporting tools for statistical analysis
Build Workflow

Projects

October 2013

Plans

Stages

pentalog.fr

Jobs

Task

7
Bamboo Tasks
A Bamboo task is a small discrete unit of work
Source code checkout
Running a script
Parsing test result
Substitute version numbers
…
Is run sequentially within a job
Has specific requirements
October 2013

pentalog.fr

8
Bamboo Jobs
A Bamboo job is a single build unit within a plan
Processes tasks that are run sequentially on the same agent
Controls the order in which tasks are performed

Collects the requirements of individual tasks in the job, so that these
requirements can be matched with agent capabilities
Defines the artifacts that the build will produce

Can only use artifacts produced in a previous stage
October 2013

pentalog.fr

9
Bamboo Agents
A Bamboo agent is a service that can run job builds
2 types:
local agents run as part of the Bamboo server
remote agents run on computers, other than the Bamboo server

Defined set of capabilities
Runs builds for jobs whose requirements match the agent's capabilities.

October 2013

pentalog.fr

10
Bamboo Jobs & Agents
Capable
of

Task 1

• Requires A
• Requires B

Capable
of

D

A

Agent
1

Capable
of

B

Capable

Task

• Requires C

2

Job

Capable

C

• Requires D

of

of

Capable
of

Task
3
October 2013

• Requires E

E

Agent
2

Capable
of

pentalog.fr

A

D

Capable
of

B

Capable
of

C

11
Bamboo Stages
Stages group jobs to individual steps within a plan's build process.
Ex : compilation , test, deployment, etc.

Processes its jobs in parallel, on multiple agents (where available).
Must successfully complete all its jobs before the next stage in the
plan can be processed.
May produce artifacts that can be made available for use by a
subsequent stage.

October 2013

pentalog.fr

12
Bamboo Plans
A plan defines everything about your continuous integration build process
in Bamboo.
Groups jobs into multiple stages.
Processes stages that are run sequentially.
Specifies the default repository
Specifies how the build is triggered

Specifies notifications of build results
October 2013

pentalog.fr

13
Bamboo Build Anatomy

October 2013

pentalog.fr

14
Bamboo Artifacts
Artifacts are files created by a job build.
Logs
Code browser
Code coverage
Copy Detector
Check Style
Mess Detector
Pdepend

October 2013

pentalog.fr

15
How we use it
Practical example
Tests
Failures
Notifications

October 2013

pentalog.fr

16
www.pentalog.fr

Thank you !
p e n t a l

o g . f r

Continuous integration using Bamboo

  • 1.
    Continuous Integration (CI ) www.pentalog.fr
  • 2.
    Contents What’s CI? How doesit work? Why use it? Bamboo How we use it October 2013 pentalog.fr 2
  • 3.
    What’s CI? Concept, notapplication The practice of merging all dev working copies with a shared mainline Main goal : prevent integration problems Requires no particular tooling to deploy, though a CI server is useful October 2013 pentalog.fr 3
  • 4.
    How does itwork? October 2013 pentalog.fr 4
  • 5.
    Why use it? Revertingto a bug-free state in case of build failures Avoid last minute chaos at release dates Immediate unit and integration testing of all changes Limit the risk of regression Immediate feedback to developers on the quality, functionality, or system-wide impact of code they are writing Metrics generated from automated testing and CI focus developers on developing functional, quality code October 2013 pentalog.fr 5
  • 6.
    GIT Branching master project user 1 user2 Commit Build OK Launch unit tests Build KO October 2013 pentalog.fr 6
  • 7.
    Bamboo CI server automated buildingand testing of software source-code updates on successful/failed builds reporting tools for statistical analysis Build Workflow Projects October 2013 Plans Stages pentalog.fr Jobs Task 7
  • 8.
    Bamboo Tasks A Bambootask is a small discrete unit of work Source code checkout Running a script Parsing test result Substitute version numbers … Is run sequentially within a job Has specific requirements October 2013 pentalog.fr 8
  • 9.
    Bamboo Jobs A Bamboojob is a single build unit within a plan Processes tasks that are run sequentially on the same agent Controls the order in which tasks are performed Collects the requirements of individual tasks in the job, so that these requirements can be matched with agent capabilities Defines the artifacts that the build will produce Can only use artifacts produced in a previous stage October 2013 pentalog.fr 9
  • 10.
    Bamboo Agents A Bambooagent is a service that can run job builds 2 types: local agents run as part of the Bamboo server remote agents run on computers, other than the Bamboo server Defined set of capabilities Runs builds for jobs whose requirements match the agent's capabilities. October 2013 pentalog.fr 10
  • 11.
    Bamboo Jobs &Agents Capable of Task 1 • Requires A • Requires B Capable of D A Agent 1 Capable of B Capable Task • Requires C 2 Job Capable C • Requires D of of Capable of Task 3 October 2013 • Requires E E Agent 2 Capable of pentalog.fr A D Capable of B Capable of C 11
  • 12.
    Bamboo Stages Stages groupjobs to individual steps within a plan's build process. Ex : compilation , test, deployment, etc. Processes its jobs in parallel, on multiple agents (where available). Must successfully complete all its jobs before the next stage in the plan can be processed. May produce artifacts that can be made available for use by a subsequent stage. October 2013 pentalog.fr 12
  • 13.
    Bamboo Plans A plandefines everything about your continuous integration build process in Bamboo. Groups jobs into multiple stages. Processes stages that are run sequentially. Specifies the default repository Specifies how the build is triggered Specifies notifications of build results October 2013 pentalog.fr 13
  • 14.
    Bamboo Build Anatomy October2013 pentalog.fr 14
  • 15.
    Bamboo Artifacts Artifacts arefiles created by a job build. Logs Code browser Code coverage Copy Detector Check Style Mess Detector Pdepend October 2013 pentalog.fr 15
  • 16.
    How we useit Practical example Tests Failures Notifications October 2013 pentalog.fr 16
  • 17.
    www.pentalog.fr Thank you ! pe n t a l o g . f r