当前位置:网站首页>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")
边栏推荐
- Appium automation test foundation ADB common commands (I)
- [embedded foundation] serial port communication
- 要搞清楚什么是同步,异步,串行,并行,并发,进程,线程,协程
- [Yocto RM]3 - Yocto Project Releases and the Stable Release Process
- 【永艺XY椅】试用体验
- [Yocto RM] 2 - Yocto Project Terms
- 【牛客讨论区】第四章:Redis
- [Yongyi XY chair] trial experience
- [Niuke discussion area] Chapter 4: redis
- Lmsoc: a socially sensitive pre training method
猜你喜欢

ShardingSphere-proxy-5.0.0建立mysql读写分离的连接(六)

Numpy----np. reshape()
![[embedded foundation] serial port communication](/img/b7/18fec20e2d5fa5f226c6f8bb1e93d2.png)
[embedded foundation] serial port communication

1382. balancing binary search tree - General method

基于AM335X开发板 ARM Cortex-A8——Acontis EtherCAT主站开发案例

Self supervised learning and drug discovery

【ELT.ZIP】OpenHarmony啃论文俱乐部—数据密集型应用内存压缩

Data analysts too hot? Monthly income 3W? Tell you the true situation of this industry with data

To understand what is synchronous, asynchronous, serial, parallel, concurrent, process, thread, and coroutine
![pytorch_lightning.utilities.exceptions.MisconfigurationException: You requested GPUs: [1] But...](/img/b4/8921c3ca5cd5a547768489d4a79202.png)
pytorch_lightning.utilities.exceptions.MisconfigurationException: You requested GPUs: [1] But...
随机推荐
JS 随机数(随机数 小数)
【永艺XY椅】试用体验
Cesium Click to obtain longitude and latitude (2D coordinates)
Adding text labels to cesium polygons the problem of polygon center point offset is solved
[Yocto RM]9 - QA Error and Warning Messages
Appium automation test foundation - Supplement: app package name and appactivity
Database query optimization: master-slave read-write separation and common problems
[Niuke discussion area] Chapter 4: redis
Réseau neuronal pour la solution détaillée Multi - diagrammes de fondation zéro
Prometeus 2.35.0 新特性
Centos8 operation record command version Yum redis MySQL Nacos JDK
深入解析kubernetes controller-runtime
Maimai hot post: Why are big factories keen on making wheels?
Appium自动化测试基础 — ADB常用命令(一)
205. isomorphic string
ionic4实现半星评分
Using redis bitmap to realize personnel online monitoring
Jenkins - Pipeline 语法
Cesium 多边形增加文字标签(polygon 加 label)多边形中心点偏移问题解决
1382. 将二叉搜索树变平衡-常规方法