【Jenkins】active choices reactive parameter & Groovy Postbuild插件使用!

注:以上俩插件安装下载直接去jenkins官网或者百度下载即可

一、active choices reactive parameter 插件的使用

1、被关联的参数不做改动

2、添加active choices reactive parameter参数,并使用。

 3、保存后,可在构建时看到效果了。(关联参数可是多个;脚本中还可嵌入其他脚本进行前置处理,其他脚本需要放到jenkins所在的服务器上)

参考地址:

https://blog.51cto.com/zengestudy/2306903

https://testerhome.com/topics/18654

 

二、Groovy Postbuild插件的使用

1、想要使用构建参数,必须勾选 Set jenkins user build variales

 2、在jenkins配置页面还必须赋予使用获取参数方法的权限,否则报 org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use method org.jvnet.hudson.plugins.groovypostbuild.GroovyPostbuildRecorder$BadgeManager xxx

 

 

 

 

 

 

 

 3、使用参数

 

 4、效果

5、修改显示结果的样式

例子:

addShortText(text, color, background, border, borderColor) - puts a badge with a short text, using the specified format.

 manager.addShortText("构建账户名:${manager.getEnvVariable("BUILD_USER")}", "green", "white","1px", "white") ;

引用:

https://www.cnblogs.com/yanlin-10/p/12881417.html

https://blog.csdn.net/lb245557472/article/details/89520527

https://blog.csdn.net/gzh8579/article/details/59522469

https://blog.csdn.net/weixin_34146805/article/details/92697462

https://blog.51cto.com/yht1990/2327200

 

posted @ 2020-08-07 10:56  启*敬  阅读(3483)  评论(0编辑  收藏  举报