当前位置:网站首页>Jenkins - groovy postbuild plug-in enriches build history information
Jenkins - groovy postbuild plug-in enriches build history information
2022-06-28 02:13:00 【wumingxiaoyao】
introduction
For shared Jenkins Job, There will be more than one Jenkins Pipleline Job call , For example, each time the test case is executed , send out Email Report Inform test results , You can build a public Report jenkins job, Facilitate multiple project calls . Usually Jenkins job After execution , Only Build Number And completion time , If you want to know the details, you have to click on each Build, Not intuitive enough .Groovy Postbuild
Plug in can solve this problem , It can make Build History The content is richer .
Summary
- Groovy Postbuild The plugin is introduced
- install Groovy Postbuild plug-in unit
- application Groovy Postbuild plug-in unit
Groovy Postbuild The plugin is introduced
Groovy Postbuild Official website Have introduced to , The plug-in is in Jenkins JVM perform Groovy Script . Usually based on build Results of operation ,check Some conditions and changes . for example , Can be in build history in build Add icon next to badges Or show something about build Description of .
since Groovy Postbuild 2.0 rise , Start introducing Script Security Plugin, In order to control Groovy Security of script use , Prevent hazards caused by improper use .
therefore Groovy Postbuild Yes 2 Class method :
- White White list method , You can use Groovy sandbox function
- Non White Non whitelist method , need Admin Use only after approval Manage Jenkins > In-process Script Approval.
Authorized restriction , The application part of this article uses White White list method The simple method in .
install Groovy Postbuild plug-in unit
In the application Groovy Postbuild
Before plug-in , Make sure Jenkins The plug-in is already installed on
Manage Jenkins -> Plugin Manage
After installation , Found one more Groovy Postbuild
Options
Job Configure -> Post-build Actions -> Add post-build action
application Groovy Postbuild plug-in unit
Have a look first , No application Groovy Postbuild plugin when ,Build History The only information is build number and execution time .
The effect after application can be as follows : Added some highlighted text and icons , Here's just an example , You can also customize it based on your own needs . So you can tell which one Project Name Executive Job 了 , Is it clear at a glance .
Let's see how the above effect is achieved ,
Add a parameter Project_Name, Used for selection Porject Name, Back Groovy postbuild You need to access this parameter .
Post-build Actions Partially add Groovy Postbuild plugin${manager.getEnvVariable('Project_Name')}
Access to Project_Name Variable
Groovy script:
manager.addShortText("${manager.getEnvVariable('Project_Name')}")
manager.addBadge("success.gif", "success")
manager.addWarningBadge("build Failure.")
manager.addBadge("error.gif", "failed")
边栏推荐
- Geojson format description (detailed format)
- Jenkins - Pipeline 语法
- Jenkins - Groovy Postbuild 插件丰富 Build History 信息
- Lmsoc: a socially sensitive pre training method
- Differences between cesium polygon extrudedheight and height
- Cesium obtains the latitude and longitude range of the screen
- How to optimize the "message" list of IM
- 205. 同构字符串
- Cesium color color (assignment) random color
- Jenkins - 访问 Jenkins 自定义参数变量,处理变量值中含有空格
猜你喜欢
Maimai hot post: Why are big factories keen on making wheels?
Cesium 多边形(polygon)extrudedHeight 和 height 的区别
Jenkins - Pipeline 语法
Numpy----np. reshape()
The interviewer asked: can you simulate the new operator of JS
pytorch_ lightning. utilities. exceptions. MisconfigurationException: You requested GPUs: [1] But...
【永艺XY椅】试用体验
药物发现综述-03-分子设计与优化
Original | 2025 to achieve the "five ones" goal! The four products of Jiefang power are officially released
To understand what is synchronous, asynchronous, serial, parallel, concurrent, process, thread, and coroutine
随机推荐
Jenkins - 访问 Jenkins 自定义参数变量,处理变量值中含有空格
Original | 2025 to achieve the "five ones" goal! The four products of Jiefang power are officially released
Appium automation test foundation - Supplement: app package name and appactivity
How to read a paper
Adobe Premiere Basics - common video effects (corner positioning, mosaic, blur, sharpen, handwriting tools, effect control hierarchy) (16)
Hi, you have a code review strategy to check!
Adobe Premiere Basics - general operations for editing material files (offline files, replacing materials, material labels and grouping, material enabling, convenient adjustment of opacity, project pa
COSCon'22 讲师征集令
geojson 格式说明(格式详解)
LMSOC:一种对社会敏感的预训练方法
I/o limit process and CPU limit process
Locust 性能测试 - 参数化,并发循环数据采样不重复
Take n multiple table names of a database as the values of a column in another table (the range can be a table in another database)
JS array random value (random array value)
Class initialization and callback usage
Differences between cesium polygon extrudedheight and height
9. Openfeign service interface call
Numpy----np.meshgrid()
[Yocto RM]3 - Yocto Project Releases and the Stable Release Process
Adobe Premiere Basics - common video effects (cropping, black and white, clip speed, mirroring, lens halo) (XV)