DevOps Build – Continuous Integration


Continuous Integration Introduction

DevOps Articles

An important concept of DevOps is the Continuous Integration (CI) of software. This article addresses the usefulness and necessity of CI.

Continuous Integration Definitions

Baseline

Set of files with the same tag (e.g., for release).

Branching

Branching is a technique that makes a copy of the source code to create two versions that are developed separately. After these branches have been altered by the developers, they are reassembled by a merge. There are various forms of branching. Therefore, a DevOps team must make a choice. This choice is also called the branching strategy.

Check-in

Commit, Release of the Checked out Source Code.

Check-out

Creating a work copy.

Repository

Central storage of files and history of files.

Tag

A marker, often used to indicate a version or release in several items in the repository.

Trunk

A set of files from the repository (also baseline or mainline).

Continuous Integration Concepts

Continuous Integration

Continuous Integration provides best practices to allow many programmers to run an application at a time, combining the source code, verified (static test cases), compiled and tested (dynamic test cases) at high frequency.

CI is first mentioned by Grady Booch. Then it was adopted by extreme programming. CI intends to merge source code from programmers into a shared mainline. XP proposes to integrate several times during a day. The goal is to prevent integration problems.

Continuous Integration Best Practices

CI is an elastic concept. The word “continuous” is generally interpreted differently. This concerns mainly the frequency of check-in:

  • Continuous integration, at every check-in.
  • Frequent integration once a day.
  • integration, if necessary.

In addition, there is another phenomenon that is inconsistent with CI and that is branching. As long as the branch is shorter than the CI frequency, the damage is still limited. But actually, any DevOps team that is doing branching is not busy with CI. An exception could still be release branching (also see article DevOps branching).

This article addresses the following aspects of CI:

  1. What is the lifecycle of Continuous Integration?
  2. Best practices
  3. Maturity
  4. Growth path
  5. Widely used tools

Continuous Integration Lifecycle

Figure 1 shows an overview of CI. The lifecycle starts at the source code that is stored in the source code repository, also called S-CMDB. Normally version management is included in a source code repository tool. The source codes to be used for a build are provided with a release tag. Based on these tags, an export is done and the build server can complete the compilation. Once the object code is created, the software can be tested with the created unit test cases. After generating the documents from the repository and / or source code, the object code is stored in the DML.

Lifecycle of CI
Figure 1, Lifecycle of CI

CI Best practices

  • Maintain a code repository
  • Automate the build
  • Make the build ‘self-testing’
  • Everyone commits to the baseline every day
  • Each commit (two baseline) must lead to a built-in
  • Keep the ‘build’ fast
  • Test in a clone of the production environment
  • Make it easy to get the latest deliverables
  • Everyone can see the results of the last ‘build’
  • Automate the deployment

CI Maturity

LevelLevel definitionLevel characteristicsBuild management and CI
3OptimizingFocus on process improvementTeams regularly meet to discuss integration problem and resolve them with automation, faster feedback, and better visibility.
2Quantitatively managedProcess measured and controlledBuild metrics gathered, made visible, and acted on. Build are not left broken.
1ConsistentAutomated processes applied across whole application lifecycleAutomated build and test cycle every time a change is committed. Dependencies managed. Re-use of scripts and tools
0RepeatableProcess documented and partly automatedRegular automated build and testing. Any build can be re-created from source control using automated process
-1RegressiveProcess unrepeatable, poorly controlled, and reactiveManual process for building software. No management of artefacts and reports

Table 1, CI maturity (www.devopsguys.com).

Continuous Integration growth path

LevelLevel definitionLevel characteristics
-1RegressiveThe following improvements must be made to reach Level 0.
  • Centralize the source code into one source code repository
  • Increase the check-in of the code to at least once a day. This greatly reduces the time required for the merge.
  • Automate the build so that it can be completed without manual steps (selection of source files, compilation source code, location of object code in the artefact directory).
  • Make sure the automated build is based on the repository code by extracting the in the repository set tags, making the build repeatable.
  • Ensure that unit test cases are performed at the build
0RepeatableThe following improvements must be made to reach Level 1.
  • Create a local build server per developer
  • Make sure that the central trunk is copied to the local build server before the local check-in takes place. The central trunk may not be broken.
  • Be sure to check in on the central trunk only if the local check-in does not provide any errors. This prevents the negative impact by the developers on each other.
  • Agree that in case of a break of the central build, all developers help to resolve the break. There may be no check-in on a broken central trunk until recovery of the central build.
  • Automate the build with a commit at local and central level
  • Make sure that the build server takes into account the dependencies of the software modules by compiling the software modules in the correct order.
  • Standardize the build server so that all developers use the same tools and scripts. This provides a uniform deployment pipeline based on a uniform source file repository and artefact repository.
  • Perform not only system testing and system integration testing but also acceptance testing (functional and non-functional)
  • Generate documentation from the source repository and / or source code.
1ConsistentThe following improvements must be made to level 2.
  • Define metrics for the build like:
  • Build time
  • Defects found
  • Quality lable Tiobe (see article # 20)
  • Use radiators to showcase the performance of the different DevOps teams and their employees.
  • Define goals for metrics and ask employees what is needed to achieve the goals
  • Monitor the goals and status of the measures to achieve the goals
  • Prevent that a build is not being repaired within a scheduled time.
2Quantitatively managedThe following improvements must be made to reach level 3.
  • Plan a recurring meeting to conduct root cause analyses for integration issues.
  • Plan the measures for the product backlogs by making adjustments to the tools.
  • Plan a recurring meeting to set the metrics stronger so that it is sooner visible that an integration break will occur.
  • Make the metrics visible on radiators and act on them.
3OptimizingThe following steps must be taken to stay at level 3.
  • Define a set of requirements that CI must meet.
  • Review the DevOps process of each team every month to meet the CI requirements.
  • Set up improvement plans to adjust the deviations to the requirements.
  • Visualize the deviations of the DevOps teams.
  • Allow mature teams to strengthen the less mature teams by exchanging best practices.

Table 2, CI maturity growth path.

CI tools

There are many tools that can be used at CI. Examples are:

  • Version control tools:
    • CVS
    • GIT
    • Mercurial (selenic)
    • RabbitCVS
    • Serena Dimensions
    • Subversion
  • Build tools:
    • Jenkins
    • mk
    • Make
    • PVCS make
  • Repository tools:
    • Sonatype Nexus
    • Artifactory
LinkedIn Group

Discuss with us about this article on LinkedIn.

More information

Related Books:

DevOps Best Practices, ISBN: 9789492618078
Agile Service Management with Scrum, ISBN: 9789071501807

Related training sessions:

Related Article:

Service Management

Samenvatting
DevOps Build - Continuous Integration
Artikel
DevOps Build - Continuous Integration
Beschrijving
An important concept of DevOps is the Continuous Integration (CI) of software. More about usings tags as a marker. They are often used to indicate a version or release in several items in the repository. This article addresses the usefulness and necessity of Continuous Integration.
Auteur
Publisher Naam
ITpedia
Publisher Logo
Sidebar