Theoretical knowledge of CI continuous integration


(1) What is Ci

What is CI?

CInamelyContinuous integrationContinuous integration is a kind of software development practice, that is, team members often integrate their work, usually each member integrates at least once a day, which means that integration may occur many times a day. Every time we gather in ChengduConstruction of automation system(including compilation, release, automated testing) to verify, so as to find integration errors as soon as possible. Many teams find that this process can greatly reduce the integration problems, so that the team can develop cohesive software faster.
🐵PS: integrate a series of processes in the enterprise on the CI platform. You can write scripts, click execute, or execute regularly.

CDnamelyContinuous delivery, it is based on CI. After completing the software construction and testing in CI and forming a new version, the next step is to deliver. Here, the delivery is not delivered to the production environment, but to the class production environment. We can understand it as a gray environment or pre release environment, and then accept the test of some real traffic, If there are no problems, deploy to the production environment manually.

Common tools of CI:Jenkins


Development > submit code > static code scanning (checking errors in code directly through tools) > unit test > compile > test > release

What is Jenkins( It’s a CI tool)

JenkinsIs an independent open source software project based onJavaA method of developmentContinuous integration tools, which is used to monitor continuous and repetitive work, and aims to provide an open and easy-to-use software platform to make continuous integration of software possible. Formerly Hudson, it is a scalable continuous integration engine. It can be used to automate various tasks, such asBuild, test and deploy software

  • Mainly used for

    • Continuously and automatically build projects, test software projects, etc.

      It mainly providesChange perception based on version management tools (such as CVs, VSS, SVN)orContinuous integration on a daily basis, and provideContinuous integration ReportEmail(provide rich plug-in libraries) and other ways to inform relevant principals that the project that needs daily construction has prepared a fully automatic project compilation script (which can be based on Maven or ant).

    • Monitor some scheduled tasks.

Jenkins features

  • Open source free
  • Cross platform, support all platforms(Linux、mac、windows)
  • Support distributed build(you can build multiple automated scripts on Jenkins, such as one running smoke test and one running regression test)
  • Visual management page in web form
  • Simple installation and configuration
  • Tips tips quick help
  • There are already a lot of plug-ins(e.g. email extension, GIT, GitHub, subversion)

(2) The value of Ci

  1. Reduce risk
    The earlier the error is found, the lower the cost of correction.
    Timely check the health of software testing, reduce the risk of release.
    (for example: trigger automatic test projects regularly every day and generate reports automatically)

  2. Reduce repetitive work
    Through automated continuous integration, you canCompile, deploy, testSuch actions become automatic without too much manual intervention.

  3. Software can be deployed anytime, anywhere
    With continuous integration, you can often make some small changes to the source code, and integrate these changes with other code. If there is a problem, the project members will be informed immediately.

(3) The architecture of Ci