注:以上倆插件安裝下載直接去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