📜 ⬆️ ⬇️

In a section: the news aggregator on Android with backend. Sequential integration system

Introduction (with links to all articles)

“The system of sequential integration” is not sure that the translation is correct - it is better to call the system of continuous integration (continuous integration).
I encountered them for the first time at the beginning of my work, when 5-7 programmers intensively wrote code and tests, changed configuration files and poured all their results into trunk / master. As a result, quite often (so often that already enraged) something non-working appeared in the main branch. Moreover, this was revealed when it was necessary to deploy a test bench, which greatly slowed down the work of the testing team (they waited for the fix) and the developers (corrected accordingly). Those. Code performance was not monitored after it was placed in the repository.

image
Then Hudson (http://hudson-ci.org/) came to the rescue (now better known as Jenkins (https://jenkins.io/) , although formally Hudson himself remained, but not so popular and not so actively developing ) - he did a lot of things:


This was a real step forward in terms of improving the quality and transparency of the work of the development team (I'm not talking about minimizing the likelihood of “porridge” in master / trunk):

')
But it was all before. Now the question is: what is the point of using a system of continuous integration when working alone?
Until a certain point there was really no meaning. Until the project grew (even with the participation of a single developer) and then the presence of the integration server showed its real value:


Additional interesting features of Jenkins are its interface, allowing you to monitor:


Pipeline


The most significant functional improvement of Jenkins after some time of not using it was for me the appearance of the Pipeline plugin, which allows either through the interface of Jenkins itself or through a separate configuration file of the project itself ( Jenkinsfile file) to determine what will be executed / started / checked CI server when getting the code of your project / module.

This approach allows separating the repository polling configuration steps (performed in the Jenkins interface) and configuring the testing / integration procedures themselves (the Jenkinsfile file), allowing the developer or person responsible for the deployment to configure / modify / add the necessary testing / integration stages without access to Jenkins.

For example, in one of my sub-projects, the Jenkinsfile file has the following content:
 #!groovy node { def projectName = 'glr_parser' def gradleHome = tool name: 'gradle', type: 'gradle' stage('Checkout') { // for display purposes // Get some code from a GitHub repository // parent directory checkout changelog: true, poll: false, scm: [$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CleanBeforeCheckout']], submoduleCfg: [], userRemoteConfigs: [[url: 'story_line2_build.github.com:fedor-malyshkin/story_line2_build.git']]] // project itself checkout changelog: true, poll: true, scm: [$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: "${projectName}"]], submoduleCfg: [], userRemoteConfigs: [[url: "story_line2_${projectName}.github.com:fedor-malyshkin/story_line2_${projectName}.git"]]] // deployment // checkout changelog: true, poll: false, scm: [$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: 'deployment']], submoduleCfg: [], userRemoteConfigs: [[url: 'story_line2_deployment.github.com:fedor-malyshkin/story_line2_deployment.git']]] } stage('Assemble') { dir(projectName) { // Run the maven build sh "'${gradleHome}/bin/gradle' -Pstand_type=test assemble" } } stage('Test') { dir(projectName) { try { sh "'${gradleHome}/bin/gradle' -Pstand_type=test test" } finally { junit "build/test-results/test/TEST-*.xml" } } } } 

As you can see, this is actually a slightly upgraded groovy (DSL for Jenkins). Pilpeline consists of stages, steps and nodes. At the same time, the stages are reflected in the Stage View Plugin, which everyone loves to show in presentations and other performances.

At the same time, the developer has the right to determine for himself whether he plans to limit himself to the verification stage: launching unit tests, verification of coding standards, launching integration tests, or placing tested artifacts into a production unit (thus implementing the principle of Continuous Delivery).

Tips




At the moment, from the Jenkins minuses, we can note only insufficient documentation on the product: often in the documentation section on the developer’s website you can see the inscription: “This is still very much a work in progress” . However, this should not repel from a truly flexible and powerful product.

Thanks for attention!

Source: https://habr.com/ru/post/334730/


All Articles