当前位置:网站首页>Jenkins' common build trigger and hook services (V)
Jenkins' common build trigger and hook services (V)
2022-06-28 08:01:00 【m0_ fifty-nine million four hundred and thirty thousand one hun】
List of articles
One 、Jenkins built-in 4 Build triggers :
- Trigger remote build
- Trigger after other projects are built (Build after other projects are build)
- Time to build (Build periodically)
- polling SCM(Poll SCM)
1. Trigger remote build


The website path that triggers the construction is url:http://192.168.74.8:8888/job/web_demo_pipeline/build?token=8888
Format :
jenkins website + The path of replication ( hold TOKEN_NAME Change to the authentication token you entered )

2. Trigger after other projects are built
First create a free build project 

Configure in the previous project 
Build the pre project of the configuration after saving 
After the pre project is built , The configured project has also started to build


3. Time to build
Enter the project configuration and click Build periodically
Some examples of timed expressions :
Every time 30 Build once in minutes :H On behalf of the parameter H/30 * * * * 10:02 10:32
Every time 2 Build once an hour : H H/2 * * *
Daily 8 spot ,12 spot ,22 spot , Build... In a day 3 Time : ( Multiple time points are separated by commas ) 0 8,12,22 * * *
Every day at noon 12 Build once on a regular basis H 12 * * *
Every afternoon 18 Build once on a regular basis H 18 * * *
Every... In the first half of every hour 10 minute H(0-29)/10 * * * *
Every two hours , Every weekday in the morning 9 Point to the afternoon 5 spot ( Maybe in the morning 10:38, Afternoon 12:38, Afternoon 2:38, Afternoon
4:38) H H(9-16)/2 * * 1-5
Every time 2 Minutes to start automatic build 
4. polling SCM
polling SCM, When specified, scan the local code warehouse for code changes , If the code changes, the project build is triggered .
The only difference between it and timed construction is , Only when the code warehouse changes , Will trigger the build , If there is no change , It doesn't trigger ,






Waiting for 2 Minutes to find out if the code doesn't change , Will not build .
Summary :
Build and poll regularly SCM The difference is that , A scheduled build does not look at changes in the code in the project , Automatically build when time comes , And polling SCM The code of the local code warehouse will be scanned for changes according to the specified time , If the code changes, the project build is triggered
Two 、Gitlab To configure webhook
1. Turn on webhook function
Gitlab On the server root Account login to the background , Click on Admin Area -> Settings -> Network Check "Allow requests to the local network from web hooks and services"
First use root Administrator login Gitlab




Switch to the current project for setting


2. Add... To the project webhook, add to webhook and Gitlab plug-in unit
Click item ->Settings->Integrations





To test 

Will report a mistake 
Manage Jenkins->Configure System

go back to gitlab Last time test
idea Change the development environment code and submit the code 



3、 ... and 、Jenkins Parametric construction of
Sometimes in the process of building a project , We need to input some parameters dynamically according to the user's input , This will affect the results of the entire build , In this case, we can use parametric construction
Jenkins Support very rich parameter types
1. Building configuration
go back to web_demo_pipeline Remove all build trigger options from the project

After saving successfully, you will see the following effect

Next, I'll show you how to enter gitlab The branch name of the project to deploy different branch projects .
2. Project creation Branch , And push it to Gitlab On






3. see Gitlab The branch on

边栏推荐
- Kubernetes理论基础
- Installing redis on Linux
- The solution of "user account control to continue, please enter administrator user name and password" appears in win10 Professional Edition
- Hj21 simple password
- Ambari (VI) -- ambari API use
- Ambari (VII) --- ambari integrated hue4.2 document (valid for personal test)
- Design and implementation of spark offline development framework
- Ambari (V) ---ambari integrated Azkaban (valid for personal test)
- SQL analysis (query interception analysis for SQL optimization)
- Sword finger offer|: linked list (simple)
猜你喜欢

A single node obtains the lock lock of the order number

Kubernetes cluster command line tool kubectl

Design of DSP image data stream

Application of XOR. (extract the rightmost 1 in the number, which is often used in interviews)

Soft test -- software designer -- database design of afternoon questions

Porting ucosiii to stm32f429

Vagrant installation

Analyze 5 indicators of NFT project

Resizing node of rediscluster cluster cluster mode

Section Xi. Axi of zynq_ Use of DMA
随机推荐
Localization SoC development plan
MySQL two table connection principle (understand join buf)
Flutter realizes the function of "shake"
Disposition Flex
Is it reliable for the top ten securities companies to register and open accounts? Is it safe?
MySQL implements transaction persistence using redo logs
Study notes 22/1/10
ROS 笔记(08)— 服务数据的定义与使用
HJ整数与IP地址间的转换
es数据导出csv文件
At 19:00 on Tuesday evening, the 8th live broadcast of battle code Pioneer - how to participate in openharmony's open source contribution in multiple directions
Static resource compression reduces bandwidth pressure and increases access speed
sql主从复制搭建
ROS 笔记(09)— 参数的查询和设置
The solution of "user account control to continue, please enter administrator user name and password" appears in win10 Professional Edition
7-2 Finnish wooden chess structure Sorting
"Three routines" of digital collection market
Kubernetes理论基础
Activity隐式跳转
Eslint 语法监测关闭