What is the use of jenkins _jenkins how to automatically deploy

What is Jenkins?

Jenkins is an open source, continuous integration (CI) tool that provides a friendly interface, originated from Hudson (Hudson is commercial), mainly for continuous, automated build/test software projects, monitoring the operation of external tasks (this abstraction For the time being, don't explain it.) Jenkins is written in Java and can be run in popular servlet containers such as Tomcat, or it can run independently.

Usually used in conjunction with version management tools (SCM), build tools; commonly used version control tools are SVN, GIT, build tools are Maven, Ant, Gradle.

Jenkins features

Easy to install

No need to install, no database, just use java -jar jenkins.war or deploy to a servlet container

Easy to configure

All configurations may be done through the web interface provided by Jenkins, although you can also configure it by manually modifying the xml file if you prefer.

Generate a test report for JUnit or TestNG

File identification

Jenkins can track which jar packages are generated for each build and which version of the jar package to use.

Distributed build

Plugin support

Jenkins can be extended with third-party plugins, or plugins can be developed based on team needs.

Tasks and builds in Jenkins

A task is an execution plan of Jenkins, a collection of operations, and a build is a run of Jenkins's tasks.

noun

CI

Full name in English: ConTInuous IntegraTIon

Chinese full name: continuous integration tool

Continuous integration is a software development practice. In continuous integration, team members frequently integrate their work, usually at least once a day, or multiple times per person. Each integration is automatically verified (including automated testing) to detect integration errors as quickly as possible.

SCM

English full name: Source Control Management (Software Version Control)

Chinese full name: source control management software version control

Jenkins automatically compiles and deploys web applications

Initial contact with the continuous integration automation process, this article mainly introduces the way of continuous integration based on Jenkins, through the case introduction online automatic compilation and deployment configuration process

Continuous integration

Continuous integration is a software development practice in which team development members often integrate their work, with at least one integration per member per day, which means multiple integrations per day. Each integration is verified through automated builds (including compilation, publishing, automated testing) to detect integration errors as early as possible.

Jenkins

Jenkins is a continuous integration tool developed in Java to monitor continuous repetitive work. Features include:

1. Continuous software release/test project.

2. Monitor the work performed by external calls.

For more information, please poke the official website

installation

There are a lot of Jenkins installation and configuration tutorials online. For details, please stamp Jenkins installation and configuration.

Start a DEMO

background

Jenkins runs on a Linux server, tries to compile and deploy a web application on this server, the build process requires a node environment, and the compiled file needs to be ssh to the test server.

Jenkins mainly completes the tasks as follows:

1, automatic integration of the compilation environment

2, online compilation application

3, ssh to the target environment and run

Create a new job

Log in to Jenkins to see the current build of all integrated projects;

1. Click [New] in the upper left corner to create a new task.

What is the use of jenkins _jenkins how to automatically deploy

2, fill in the task name, the type of project can be selected according to the actual situation, this time you can choose the first one

What is the use of jenkins _jenkins how to automatically deploy

3. After the selection is completed, click [OK] to return to the home page and find that the created job is displayed in the list.

Configuration compilation environment

In this process, we need to configure a node-based build environment for the application.

About installing node, you can generally download the executable file installation or compile the source installation, and with Jenkins, we can consider using the plug-in provided for automatic installation.

1, select system management - "management plugin

What is the use of jenkins _jenkins how to automatically deploy

2, you can see that Jenkins provides a rich plug-in for developers to use, find the [NodeJS Plugin] we need, check it and click Install.

What is the use of jenkins _jenkins how to automatically deploy

3. After the installation is complete, select System Management - "Global Tool ConfiguraTIon" to configure node download and installation.

What is the use of jenkins _jenkins how to automatically deploy

4. After entering, go to the bottom and find that the NodeJS configuration item has appeared in the global available tools.

5, the plug-in supports a variety of ways to install nodeJS, click [New Installation], select the custom installation method, here to download and install the configuration from the node official website

What is the use of jenkins _jenkins how to automatically deploy

6. After saving, go through the list, enter the newly created Job, find [Building Environment], check the Provide Node & npm bin/ folder to PATH, select the configuration you just added, and then each time you build, it will be executed first. After the environment is built and the environment is built correctly, the real build process will begin.

What is the use of jenkins _jenkins how to automatically deploy

Configuring the build process

In this process, we can configure the parameters required for the build to indicate the location of the build (from which branch/what version...) or some other state; and execute the build with the command.

1. Enter the job details through the list to start the relevant configuration;

2. The [General] column needs to configure the project basic information and some parameters required for the build. Select [Parameterized Build], this build method allows us to customize the parameters in the build process. As follows: Configure a branch parameter to indicate the git branch to be built

What is the use of jenkins _jenkins how to automatically deploy

3, [source management] column needs to fill in the source code of the project to be built, where [Branches to build] is used to indicate the branch to be built, of course, you can also choose a submission number, and here we can also use us in General Variables are defined (see [Help] button on the right side of the input box for details)

What is the use of jenkins _jenkins how to automatically deploy

4, [Build] column needs to input relevant commands to achieve automated build, this process is after [environment build], so we can write the following code to execute the build

What is the use of jenkins _jenkins how to automatically deploy

5. After the online compilation is completed, the files completed by the build are sent to the target environment (test environment/production environment). Continue to add configuration in the [Build] column, specify the target environment related information; command line configuration ssh after some operations (decompress files, and delete the compressed package)

What is the use of jenkins _jenkins how to automatically deploy

Execution build

At this point, the configuration of the entire build is basically completed, and the build begins below.

Go back to the list page and click on Build:

What is the use of jenkins _jenkins how to automatically deploy

You can see the progress of the current build in the build history list.

What is the use of jenkins _jenkins how to automatically deploy

Click on the left button to enter the console to view the output.

After the build is complete, you can view the build results from the rainy status in the list.

Conclusion

This article briefly introduces the process based on Jenkins build, Jenkins features a lot, will be introduced in the following pages. As the scale and complexity of project development continue to increase, continuous integration is an inevitable choice.

Modified Sine Wave Solar Inverter

Modified Sine Wave Solar Inverter,Modified Sine Wave Inverter 800W,Ac Inverter For Automobile,Modified Sine Wave Home Inverters

GuangZhou HanFong New Energy Technology Co. , Ltd. , https://www.gzinverter.com

Posted on