jenkins - 在 Jenkins 管道中使用 GroovyPostbuildSummaryAction
问题描述
如何GroovyPostbuildSummaryAction
在我的 Jenkins 管道中使用?我试过了:
import org.jvnet.hudson.plugins.groovypostbuild.*;
但它不起作用:
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
WorkflowScript: 81: unable to resolve class GroovyPostbuildSummaryAction
@ line 81, column 34.
GroovyPostbuildSummaryAction action = new GroovyPostbuildSummaryAction("star-gold.png");
我想在我的管道中使用共享库并使用以下代码段进行测试:https ://gist.github.com/hayderimran7/7a49d0fa484f7561120b4190f8f3a888#file-retro-add-badges-groovy
解决方案
例如,不清楚您是否调用该操作
GroovyPostbuildSummaryAction action = new GroovyPostbuildSummaryAction('star-gold.png')
action.appendText('Comment line',false)
currentBuild.rawBuild.getActions().add(action)
以上对我有用(我们目前使用 GroovyPostBuild 插件 2.3.1)
推荐阅读
- javascript - React 无法添加属性更新器,对象不可扩展
- mysql - ALTER TABLE DROP COLUMN - 服务器状态“已停止”
- python - 如何使用自定义名称运行进程?
- java - 无法在 JPA 查询中进行投影
- azure - 启用部署槽
- ios - macOS Catalina 上的颤振“设备不支持无线同步”错误
- concurrency - 当 2 个进程尝试同时读取系统时钟时是否存在竞争条件?
- javascript - 从对象属性中删除双引号,除非以数字开头
- html - safari mobile 13 中的移动 Web 应用程序功能和视口
- javascript - AWS 网关超时