我正在尝试使用jenkins JOB-DSL生成工作,我无法找到在freestylejob中作为发布者触发诱惑报告的方法
job('ci') {
publishers {
allure([includeProperties: false, jdk: '', results: [[path: 'Result']]])
}
}
我甚至尝试搜索https://jenkinsci.github.io/job-dsl-plugin也尝试了https://job-dsl.herokuapp.com/来完成这项工作。但没有运气。 但是得到以下错误:
javaposse.jobdsl.dsl.DslScriptException: (script, line 5) No signature of
method: javaposse.jobdsl.dsl.helpers.publisher.PublisherContext.allure()
is applicable for argument types: (java.util.LinkedHashMap) values:
[[includeProperties:false, jdk:, results:[[path:Result]]]]
Possible solutions: mailer(java.lang.String), use([Ljava.lang.Object;),
asType(java.lang.Class)
at javaposse.jobdsl.dsl.AbstractDslScriptLoader.runScriptEngine(AbstractDslScriptLoader.groovy:112)
at javaposse.jobdsl.dsl.AbstractDslScriptLoader$_runScripts_closure1.doCall(AbstractDslScriptLoader.groovy:59)
at javaposse.jobdsl.dsl.AbstractDslScriptLoader.runScripts(AbstractDslScriptLoader.groovy:46)
at javaposse.jobdsl.dsl.AbstractDslScriptLoader$runScripts$0.callCurrent(Unknown Source)
at javaposse.jobdsl.dsl.AbstractDslScriptLoader.runScript(AbstractDslScriptLoader.groovy:85)
at javaposse.jobdsl.dsl.AbstractDslScriptLoader$runScript.call(Unknown Source)
at com.sheehan.jobdsl.DslScriptExecutor.execute(DslScriptExecutor.groovy:27)
at com.sheehan.jobdsl.ScriptExecutor$execute.call(Unknown Source)
at Ratpack$_run_closure1$_closure3$_closure7$_closure8.doCall(Ratpack.groovy:32)
at com.sun.proxy.$Proxy10.execute(Unknown Source)
at ratpack.exec.internal.DefaultPromise$1.success(DefaultPromise.java:42)
at ratpack.exec.Promise.lambda$null$9(Promise.java:304)
at ratpack.exec.Downstream$1.success(Downstream.java:73)
at ratpack.exec.Promise.lambda$null$9(Promise.java:304)
at ratpack.exec.Downstream$1.success(Downstream.java:73)
at ratpack.exec.internal.DefaultExecution$2.lambda$success$1(DefaultExecution.java:161)
at ratpack.exec.internal.DefaultExecution$SingleEventExecStream.exec(DefaultExecution.java:419)
at ratpack.exec.internal.DefaultExecution.exec(DefaultExecution.java:246)
at ratpack.exec.internal.DefaultExecution.intercept(DefaultExecution.java:240)
at ratpack.exec.internal.DefaultExecution.drain(DefaultExecution.java:220)
at ratpack.exec.internal.DefaultExecution.access$100(DefaultExecution.java:45)
at ratpack.exec.internal.DefaultExecution$SingleEventExecStream.resume(DefaultExecution.java:452)
at ratpack.exec.internal.DefaultExecution$2.success(DefaultExecution.java:161)
at ratpack.server.internal.RequestBody.complete(RequestBody.java:125)
at ratpack.server.internal.RequestBody.add(RequestBody.java:76)
at ratpack.server.internal.NettyHandlerAdapter.channelRead(NettyHandlerAdapter.java:84)
at io.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java:83)
at io.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java:163)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:155)
at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86)
at io.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java:83)
at io.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java:163)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:155)
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111)
at io.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java:83)
at io.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java:163)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:155)
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:276)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:263)
at io.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java:83)
at io.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java:163)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:155)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:950)
at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:818)
at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:338)
at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:254)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:742)
at ratpack.exec.internal.DefaultExecController$ExecControllerBindingThreadFactory.lambda$newThread$0(DefaultExecController.java:113)
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137)
Caused by: groovy.lang.MissingMethodException: No signature of method: javaposse.jobdsl.dsl.helpers.publisher.PublisherContext.allure() is applicable for argument types: (java.util.LinkedHashMap) values: [[includeProperties:false, jdk:, results:[[path:Result]]]]
Possible solutions: mailer(java.lang.String), use([Ljava.lang.Object;), asType(java.lang.Class)
at javaposse.jobdsl.dsl.AbstractExtensibleContext.methodMissing(AbstractExtensibleContext.groovy:19)
at javaposse.jobdsl.dsl.AbstractContext.invokeMethod(AbstractContext.groovy)
at script$_run_closure1$_closure2.doCall(script:5)
at script$_run_closure1$_closure2.doCall(script)
at javaposse.jobdsl.dsl.ContextHelper.executeInContext(ContextHelper.groovy:16)
at javaposse.jobdsl.dsl.ContextHelper$executeInContext.call(Unknown Source)
at javaposse.jobdsl.dsl.ContextHelper$executeInContext.call(Unknown Source)
at javaposse.jobdsl.dsl.Job.publishers(Job.groovy:628)
at script$_run_closure1.doCall(script:3)
at javaposse.jobdsl.dsl.JobParent.processItem(JobParent.groovy:104)
at javaposse.jobdsl.dsl.JobParent.freeStyleJob(JobParent.groovy:46)
at javaposse.jobdsl.dsl.JobParent$freeStyleJob$0.callCurrent(Unknown Source)
at javaposse.jobdsl.dsl.JobParent$freeStyleJob$0.callCurrent(Unknown Source)
at javaposse.jobdsl.dsl.JobParent.job(JobParent.groovy:38)
at javaposse.jobdsl.dsl.DslFactory$job.callCurrent(Unknown Source)
at script.run(script:1)
at script$run.call(Unknown Source)
at script$run.call(Unknown Source)
at javaposse.jobdsl.dsl.AbstractDslScriptLoader.runScript(AbstractDslScriptLoader.groovy:132)
at javaposse.jobdsl.dsl.AbstractDslScriptLoader.runScriptEngine(AbstractDslScriptLoader.groovy:106)
... 49 more
有人可以给我任何诱惑片吗?
答案 0 :(得分:0)
我找到了。我需要使用动态DSL。 注意:这不能在命令行或操场上测试。但它只适用于詹金斯。
这是带有倾向报告配置的自由式作业的动态dsl。
publisher {
allure {
results {
resultsConfig {
path('Result')
}
}
}
}
答案 1 :(得分:0)
https://docs.qameta.io/allure/#_job_dsl_plugin
// default
publishers {
allure(['allure-results'])
}
// advanced
publishers {
allure(['first-results', 'second-results']) {
jdk('java7')
commandline('1.4.18')
buildFor('UNSTABLE')
includeProperties(true)
property('allure.issues.tracker.pattern', 'http://tracker.company.com/%s')
property('allure.tests.management.pattern', 'http://tms.company.com/%s')
}
}