当前位置:网站首页>Jenkins operation Chapter 5 trigger, configuration webhook, Jenkins parameterized construction
Jenkins operation Chapter 5 trigger, configuration webhook, Jenkins parameterized construction
2022-06-29 05:49:00 【Limensen deer】
List of articles
1、Jenkins Trigger type
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)2、 Trigger remote build
establish new item project web_app01
Application save
Authentication token arbitrary , Remember not to change
URL:http://192.168.199.133:8888/job/web_demo_pipeline/build?token=8888
open web, Input URL, Trigger Jenkins An automated build
3、 Trigger after other projects are built
First create pre_project Front assembly line engineering

Recent examples of pre engineering , There is no need to git Pull the code , Just output the statement

Back to what you just created web_app01 In project configuration

Start building front projects

Manually build the front project , Trigger directly after the pre project is built web_app01 project

4、 Time to build
The timing strings from left to right are ; branch when Japan month Zhou
Case study
Every time 30 Build once in minutes (H On behalf of the parameter ):H/30 * * * *
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-5go back to web_app01 project


5、 polling SCM
polling SCM, When specified, scan the local code warehouse for code changes , If the code changes, the project build is triggered

Be careful : This time build triggers ,Jenkins The code of the whole local project will be scanned regularly , Increase the cost of the system , Not recommended .
modify idea Code commit to gitab in
See if it is built automatically

6、 Turn on webhook function
land gitlab in , Use root Account login to the background , Click on Admin Area -> Settings -> Network
Check Allow requests to the local network from web hooks and services






The second step go back to Jenkins in
Add... To the project webhook, Add the plug-in “ webhook and gitlab ” plug-in unit

stay web_app01 Project configuration

stay gitlab Add to the project webhook


go back to Jenkins





Be careful : The following settings must be completed , Otherwise, the report will be wrong
manage Jenkins------》Configure system


go back to gtlab The test again


Automatically use after success webhook Completion of construction

After changing the code of the development environment

Submit code ,Jenkins Automatically create

7、 Parametric construction
7.1、 Introduction function
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 ,
At this time We can use parameterization to build .Jenkins Support very rich parameter types .
Imagine a real application scenario , In a big project , It is certainly impossible to have only one version , There may be major versions ,v1,v2 wait .
Now master Branches store the main version of the code ,v1 Branch on deposit v1 Version code , Isolate from each other without interference .
At this point, parameterized construction can be useful .7.2、jenkins Enable the parametric build function
go back to web_app01 Cancel all build trigger options in


Click apply to save 

Project creation Branch , And push to gitlab in
Be careful :SCM In the code of , Must put master Switch to ‘‘branch’’






7.3、 Create a new branch and push and build the publication
The new branch V1







structure master Branch project code



structure V1 Branch code



边栏推荐
- Domain name hack
- 嵌入式RTOS
- 2022 recommended cloud computing industry research report investment strategy industry development prospect market analysis (the attachment is a link to the online disk, and the report is continuously
- 證券開戶安全麼,有沒有什麼危險呢
- Open source demo| you draw and I guess -- make your life more interesting
- Analysis report on the investment market situation of the development planning prospect of the recommended chip industry research industry in 2022 (the attachment is a link to the network disk, and th
- Analysis report on the investment market of the development planning prospect of the recommended rare earth industry research industry in 2022 (the attachment is a link to the online disk, and the rep
- How to use thread stack location
- Embedded RTOS
- 轻松入门自然语言处理系列 专题7 基于FastText的文本分类
猜你喜欢

Introduction to Photoshop (the first case)

2022 recommended prefabricated construction industry research report industry development prospect market analysis white paper (the attachment is a link to the network disk, and the report is continuo

JS messagechannel transport

2022 recommended property management industry research report industry development prospect market investment analysis (the attachment is the link to the online disk, and the report is continuously up

Love that can't be met -- what is the intimate relationship maintained by video chat

On February 15, the market hot money operation and the dragon and tiger list

Establishing the development environment of esp8266

Parsing rshub document auto generation API

Plugin

β- Tetraphenyl nickel porphyrin with all chlorine substitution| β- Thiocyano tetraphenyl porphyrin copper| β- Dihydroxy tetraphenyl porphyrin 𞓜 2-nitroporphyrin | supplied by Qiyue
随机推荐
[CV] wuenda machine learning course notes Chapter 13
2022-01 Microsoft vulnerability notification
ASP. Net core 6 framework unveiling example demonstration [03]:dapr initial experience
Pytest (7) -yield and termination function
Conditional test, if and case conditional test statements of shell script
VLAN experiment
51 lines of code, self-made TX to MySQL software!
How to use regex in file find
[high concurrency] deeply analyze the callable interface
Awk of shell script
Research Report on the new energy industry of recommended power equipment in 2022 industry development prospect market investment analysis (the attachment is a link to the network disk, and the report
Spark saving to external data source
Why Houdini made the pyside2 plug-in crash
Top ten Devops best practices worthy of attention in 2022
HTTP Caching Protocol practice
Meso tetra (4-N, N, n-trimethylaminophenyl) porphyrin (ttmapp) /meso tetra - [4- (BOC threonine) aminophenyl] porphyrin (TAPP thr BOC) supplied by Qiyue
Loosely matched jest A value in tohavebeencalledwith - loose match one value in jest toHaveBeenCalledWith
patent filter
證券開戶安全麼,有沒有什麼危險呢
Test content
