Jenkins and Continuous Integration

Jenkins continuous integration

If you want to add an automatic deployment process to your job, you can write an automated deployment script first and then call the corresponding Script in the Execute Shell of the jenkins build task. ( https://www.zhihu.com/question/25385945 )

Continuous integration process:

  1.   After RD develops and submits the code, Jenkins automatically compiles and publishes it to the temporary product repository
  2.   RD automatically deploys the compiled version from the temporary product library to the development environment for self-testing, and then initiates a test to QA after passing the test
  3.   QA deploys the version number detected by RD to the test environment through Jenkins for testing
  4.   After the QA test is passed, the version is released to the official product library through Jenkins
  5.   OP deploys the version from the official product library to the online environment through jenkins

Reference link: http://blog.csdn.net/john_cdy/article/details/7738393

The main process of building a continuous integration environment is that Jenkins will run in the background, polling the version-controlled repository, and when a change is found in the version repository, the project will be built through a predefined build script, and Jenkins will build the project according to the project requirements. The tasks are assigned to the Slave side. The general project construction process is mainly divided into two stages: automatic compilation and automatic testing, which are also the stages where your script plays a role.

Select "Build when a change is pushed to GitHub" and "Poll SCM" in "Build Trigger". The functions of these two are to trigger Jenkins to build when GitHub has a repository update and to periodically check if the repository is updated. , triggers Jenkins to build if there is an update.

Reference link: http://blog.csdn.net/wangmuming/article/details/22925127

build trigger

Execute build after other projects have finished building: Trigger the build of this project after the specified project has finished building.

Poll SCM: This is a common option in CI systems. When you select this option, you can specify a cron job expression to define how often Jenkins checks your source code repository for changes. If a change is found, a build is performed. For example, filling in the expression 0,15,30,45 * * * * will cause Jenkins to check your source repository for changes every 15 minutes.

Build periodically : This option only informs Jenkins to build the project at the specified frequency, regardless of whether the SCM has changed. It is helpful if you want to run some test cases in this Job.

Reference link: http://blog.csdn.net/onlyqi/article/details/7076915

Jenkins directory structure

Like CruiseControler, Jenkins needs a directory to store related files: JENKINS_HOME. Defaults to ~/.jenkins. That is, a hidden directory under the user's home directory. We can also change JENKINS_HOME to point where we want.

Create a Project

Because Jenkins can be used to run various CI, tests, batch tasks, etc., these tasks are collectively referred to as "free-style software projects" in Jenkins.

Jenkins also provides other types of jobs, such as:

1. If the project is Maven, Jenkins also provides a job only for Maven Project. But in fact, free-style software projec can still be used to create Maven projects, but this is more suitable for Maven projects, and the combination is better.

2. You can also create a "Monitor an external job" to monitor external processes.

3, or a Matrix project, which is a multi-configuration project.

The process of creating one of the most common "free-style software projects"

  • optional SCM, such as CVS or Subversion where your source code resides. Specify where your source code resides.

Note: In software engineering, software configuration management (SCM) is the task of tracking and controlling changes in the software.

  • optional triggers to control when Jenkins will perform builds. Specifies when Jenkins will trigger a build.
  • some sort of build script that performs the build (ant, maven, shell script, batch file, etc.) where the real work happens In this script file, we can download the latest code from svn, delete the temporary files of the last build, create the necessary directories, compile the source code, run, package and a series of tasks.
  • optional steps to collect information out of the build, such as archiving the artifacts and/or recording javadoc and test results. 收集log信息。
  • optional steps to notify other people/systems with the build result, such as sending e-mails, IMs, updating issue tracker, etc. 通知相关人员build的结果。

Distributed builds

To the Jenkins management interface, you can easily add nodes. When configuring a node, you need to provide the machine where the node is located, the login user name and password, and the directory used.

But the slave does not need to install Jenkins again. Jenkins will automatically enable the slave agent, and test the tools required for the build to the remote machine.

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325301717&siteId=291194637