当前位置:网站首页>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

边栏推荐
- How to use redis to solve concurrency problems
- HJ score ranking
- ROS 笔记(08)— 服务数据的定义与使用
- Eslint 语法监测关闭
- MySQL single table access method
- Evaluation of inverse Polish expression < difficulty coefficient >
- HJ explicit random number
- Ambari (VIII) --- ambari integrated impala document (valid for personal test)
- 你了解TCP协议吗(一)?
- Study notes 22/1/17
猜你喜欢

2021 programming language ranking summary

The solution of "user account control to continue, please enter administrator user name and password" appears in win10 Professional Edition

flex布局

Rediscluster cluster mode capacity expansion node

Design and implementation of spark offline development framework

Flex layout

"Three routines" of digital collection market

Redis cerebral fissure

Static resource compression reduces bandwidth pressure and increases access speed

MySQL tablespace parsing
随机推荐
NLP sequence can completely simulate human brain intelligence
打新债注册开户靠谱吗?安全吗?
Software design of resistance test board
MySQL two table connection principle (understand join buf)
Study notes 22/1/11
剑指Offer||:链表(简单)
Host is not allowed to connect to this MySQL server
Eslint 语法监测关闭
7-2 Finnish wooden chess structure Sorting
Disposition Flex
LeetCode之三步问题
flex布局
asp. Net error "/" server error in the application. String or binary data would be truncated. The statement...
Analyze 5 indicators of NFT project
How to use redis to solve concurrency problems
Redis cerebral fissure
Vagrant installation
The solution of "user account control to continue, please enter administrator user name and password" appears in win10 Professional Edition
kubernetes集群命令行工具kubectl
Is it reliable for the top ten securities companies to register and open accounts? Is it safe?