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:
What is the lifecycle of Continuous Integration?
Best practices
Maturity
Growth path
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.
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
Level
Level definition
Level characteristics
Build management and CI
3
Optimizing
Focus on process improvement
Teams regularly meet to discuss integration problem and resolve them with automation, faster feedback, and better visibility.
2
Quantitatively managed
Process measured and controlled
Build metrics gathered, made visible, and acted on. Build are not left broken.
Automated build and test cycle every time a change is committed. Dependencies managed. Re-use of scripts and tools
0
Repeatable
Process documented and partly automated
Regular automated build and testing. Any build can be re-created from source control using automated process
-1
Regressive
Process unrepeatable, poorly controlled, and reactive
Manual process for building software. No management of artefacts and reports
Table 1, CI maturity (www.devopsguys.com).
Continuous Integration growth path
Level
Level definition
Level characteristics
-1
Regressive
The 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
0
Repeatable
The following improvements must be made to reach Level 1.
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.
1
Consistent
The following improvements must be made to level 2.
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
Bart de Best
Publisher Naam
ITpedia
Publisher Logo
Mogelijk is dit een vertaling van Google Translate en kan fouten bevatten. Klik hier om mee te helpen met het verbeteren van vertalingen.