In practice we will show our three code branching strategies

The DevOps micro-class series is designed to help users learn DevOps practices.

Business background

Question one:

Existing Build Projects on CI cannot perform tests such as UT/FT/ST and SM complexity or Lizard loop complexity checks.

Existing build projects on CI can only control source code for versions, but test code, database scripts, build and deployment scripts, dependent library files, etc., and version control of build artifacts are equally important, only those versions are included in the version. Control, to ensure that all development, testing, operation and maintenance activities can be carried out normally, the system can be completely built.

The normal pipeline cannot support multiple branches. The DailyCI, VerifyCI, and MergeCI triggered by the Gerrit trigger cannot be merged into the same build project, resulting in a lot of pipeline pipelines and complicated management.

Question 2:

The existing version release is to package the version compilation target file into the product library. In the environment deployment process, the host environment needs to be configured in advance. If the environment is complex and cumbersome, it will bring difficulties to the environment configuration. Packaging environments and versions in docker mode facilitates test deployment and live network deployment.

Solutions

1. Support for multiple branches is made easier with multibranch type pipeline jobs.

Just create a multibranch job and jenkins will automatically create a job for all the branches.

2. Build the docker environment and package the compiled version into the image, and pull the image to the product library.

Practice

In the solution, we have clarified the code branch management strategy on gerrit, and adopted different branch strategies for different branch versions. In practice, we will show our three code branch strategies.

1. Code branch strategy 1 - development branch and release branch

2. Code branch strategy 2 - feature branch (temporary branch)

3. Code Branching Strategy 3 - Fixing Bug Branches

solution

In the solution we also elaborated on our CI creation, including the creation of Multibranch Pipeline, the writing, storage and invocation of Jenkinsfile, and the full effect preview.

1. New multibranch pipeline job

2. Store the Jenkinsfile in the root directory of each branch code and write the jekinsfile script.

The script is divided into the following sections:

1) Add a property that accepts gerrit trigger events in Jekinsfile

After the configuration is successful, view the configuration in Branches and you will see the automatically generated configuration trigger page as

2) Get the change branch of gerrit required by verifyCI

3) The script handles branch branches on different gerrits

4) The script handles different gerrit trigger events

3. Automatically generate a job for each branch

After the multibranch pipeline job is saved, Jenkins automatically checks all the branches and automatically creates a job for all the branches, provided that the jenkinsfile exists. For example, the above job automatically generates the folder *-AI-*-RUNNTIME, and automatically generates jobs for the trunk and branch under this folder. If a branch branch is removed from the codebase, the multibranch pipeline will automatically detect the changes and delete the corresponding job.

4. Scan Multibranch Pipeline Now When the Multibranch Pipeline is generated for the first time, the pipeline configuration file is automatically scanned and the corresponding job is created. If the Jenkinsfile file is changed, the scan can be triggered manually. The log output is as follows:

5. This completes the completion of a complete MultiBranch Pipeline

The effect of different tasks is as follows. Different gerrit trigger tasks can be seen and managed in the same pipeline, such as patchset-created, change-merged, and daily_ci.

6. Gtest+lconv code unit test and coverage check

Output gtest unit test and lcov code coverage test result

7. Docker image is published through the product library

Elf Bar TE5000

Elf Bar TE5000 Disposable Pod Device is new hot sale style , easy carry disposable pod you ever have.The conflux of metallic and looming inside beauty.The ELF BAR TE5000 DisposableVape Device comes with a Micro-USB charging port . Mesh coil used for better flavor restore.and rich vapor for a better e-cigarette


Size: 78*42*22mm
E-liquid Capacity: 13.5ml
Nicotine Strength: 50mg/ml
Battery Capacity: 550mAh
Puffs: Up to 5000
Charging Port: Micro-USB

Elf Bar TE5000,Elf Bar TE5000 Puffs,Elf Bar TE5000 Rechargeable Vape,Elf Bar Disposable Pod. Elf Bar TE5000 Disposable E-Cigarette

Shenzhen Ousida Technology Co., Ltd , https://www.osdvape.com