Jenkins pulling github library code execution Construction

Foreword

The contents of the articles written about the timing of build, and build after sending the message, but the code that runs when we build is added manually to the Jenkins workspace. In this article we talk about Kula automatically taken from GitHub remote code execution building, ado, start! (Before you begin, we need to install the plug-in GitHub: GitHub plugin how to install it on their own Baidu)

New Project

And still the last article, we create a new free-style project (I'm not here to directly configure my new project based on the original)

Get GitHub address

Address the path of our projects

Project Configuration

General

Enter a project description, check the Github project, enter the address of the remote project

Source Management

In fact, we need to configure a public key (git how to install and use on their own Baidu) at the time of installation github, then we pull remote library code you need to configure the private key

Git private key file

Generally when installing Git generate the public key and secret key by default in the following directory

We check the source code management Git, and click [Add]

Pop-up box to add content as marked

Construction of the flip-flop

Here set the time interval to set up their own, and I remain on this set of articles, I did not move

Build Environment

Here we choose to empty it before every build Jenkins workspace, to avoid a conflict of pulling the code

Construct

Select execute windows batch command

After the build operation

After the build operation we still use the settings on the articles, just send a message with attachments (consistent with Part I)

Modify the following configuration in FIG.

The results show

Next we remain Jenkins workspace (workspace below the name of the project has been named folder) code does not move (in order to test whether the building will automatically delete a workspace before), will look at whether to build automatic pulling at the beginning of the code came GitHub

We build direct manual (the manual is no problem to build, as long as the timer set to build grammar is no problem, the time will automatically build)

Jenkins workspace

You can see the empty folder has been pulled to the top of the GitHub project code, the original code has been deleted

Jenkins log

Console logs can be seen before building work has been carried out deleted space operations and cloning remote code, look at whether QQ mailbox to receive reports

 QQ inbox

 text

annex

再看一下我们的报告是否也正常,报告目录下只有一个最新的报告

最后

是不是很完美, 当看到成功构建那一刻还是小有成就感的,好了,赶紧动手试一试!

Guess you like

Origin www.cnblogs.com/linuxchao/p/linuxchao-Jenkins-GitHub.html