当前位置:网站首页>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")
边栏推荐
- Cesium 点击绘制多边形(动态绘制多边形)
- How to study efficiently
- Appium automation test foundation ADB common commands (I)
- Where can I open an account for foreign exchange futures? Which platform is safer for cash in and out?
- [Yocto RM]8 - OpenEmbedded Kickstart (.wks) Reference
- Centos8 operation record command version Yum redis MySQL Nacos JDK
- Appium自动化测试基础— 补充:App的包名(appPackage)和启动名(appActivity)
- How to optimize the "message" list of IM
- Numpy----np.reshape()
- What problems should be evaluated before implementing MES management system
猜你喜欢
Differences between cesium polygon extrudedheight and height
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)
Evaluation - grey correlation analysis
frp实现内网穿透
基于AM335X开发板 ARM Cortex-A8——Acontis EtherCAT主站开发案例
Voice network VQA: make the user's subjective experience of unknown video quality in real-time interaction known
评价——灰色关联分析
Xctf attack and defense world misc wage earner advanced zone
TIA botu_ Concrete method of making analog input and output Global Library Based on SCL language
How to optimize the "message" list of IM
随机推荐
Is it safe to open an online futures account?
pytorch_lightning.utilities.exceptions.MisconfigurationException: You requested GPUs: [1] But...
Google Earth engine (GEE) -- an error caused by the imagecollection (error) traversing the image collection
Jenkins - Copy Artifact 插件 Build 之间数据共享传递
Deep parsing of kubernetes controller runtime
The practice of dual process guard and keeping alive in IM instant messaging development
Numpy----np.reshape()
Appium automation test foundation - Supplement: app package name and appactivity
Class initialization and callback usage
【牛客讨论区】第四章:Redis
Evaluation - grey correlation analysis
嵌入式必学!硬件资源接口详解——基于ARM AM335X开发板 (下)
Hi, you have a code review strategy to check!
【ELT.ZIP】OpenHarmony啃论文俱乐部—数据密集型应用内存压缩
style中的scoped属性和lang属性
评价——秩和比综合评价
Using redis bitmap to realize personnel online monitoring
205. isomorphic string
Jenkins - Pipeline 概念及创建方式
Cesium 获取屏幕所在经纬度范围