Couldn't configure 'Gerrit Repo' with job-dsl plugin

129 views
Skip to first unread message

Sithik Sm

unread,
Jan 30, 2018, 5:30:55 AM1/30/18
to job-dsl-plugin
Hi,

I am working with pipeline and create job-dsl script for jenkins jobs. I am trying to create jenkins job for pipeline job 'Gerrit repo' scm but couldnt find the configuration/information in api/wiki. Find the attached snippet for the jenkins job and jobdslapi. Could you guide me to the correct documentation/api or is it missing? 






























Wiki:






































Thanks & Regards,
Sithik SM

Sithik Sm

unread,
Jan 30, 2018, 10:32:09 AM1/30/18
to job-dsl-plugin
Is it possible to configure repoScm using job-dsl?

Victor Martinez

unread,
Jan 30, 2018, 12:24:27 PM1/30/18
to job-dsl-plugin
You can use the autogenerated api viewer within your own jenkins instance. Apparently the plugin you are using is: https://plugins.jenkins.io/repo which mislead with the name of the DSL vs the name of the UI.

Therefore, you can use it based on the below:
- <YOUR_JENKINS_URL>/plugin/job-dsl/api-viewer/index.html#path/pipelineJob-definition-cpsScm-scm-repoScm

Cheers

Sithik Sm

unread,
Jan 31, 2018, 2:37:35 AM1/31/18
to job-dsl-plugin
Hi Victor,

Thank you very much for the information and help to know new information. It works now.

Sithik Sm

unread,
Feb 1, 2018, 3:10:12 AM2/1/18
to job-dsl-plugin
Hi,

I tried configuring jobdsl as described below and see the below error. I tried the same in job-dsl playground and found the same. Am I missing something here?

Tried playground in link http://job-dsl.herokuapp.com/

code:
pipelineJob("OS/Platform_next_start") {
   logRotator(-1, 100, -1, 10)
   parameters {
       textParam('custom_manifest', '', "Use custom_manifest.xml in manifest_file above if you want to use it")
   }
   triggers {
     scm('H/5 * * * *')
   }
   definition {
       cpsScm {
           scriptPath("jenkins/pipeline_master.groovy")
           scm {
               repoScm {
                manifestRepositoryUrl("server")
                currentBranch(true)
                manifestBranch("master")
                manifestFile("next.xml")
                quiet(true)
               }
           }
       }
   }
}

Error info:
javaposse.jobdsl.dsl.DslScriptException: (script, line 13) No signature of method: javaposse.jobdsl.dsl.helpers.ScmContext.repoScm() is applicable for argument types: (script$_run_closure1$_closure4$_closure5$_closure6$_closure7) values: [script$_run_closure1$_closure4$_closure5$_closure6$_closure7@50adc45e]
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.ScmContext.repoScm() is applicable for argument types: (script$_run_closure1$_closure4$_closure5$_closure6$_closure7) values: [script$_run_closure1$_closure4$_closure5$_closure6$_closure7@50adc45e]
at javaposse.jobdsl.dsl.AbstractExtensibleContext.methodMissing(AbstractExtensibleContext.groovy:19)

Victor Martinez

unread,
Feb 1, 2018, 7:13:15 AM2/1/18
to job-dsl-plugin
http://job-dsl.herokuapp.com/ playground doesn't work with the autogenerated DSL. 

I was able to generate the DSL pipeline in my local jenkins box. Can you confirm whether the repo plugin has been installed in your jenkins instance? If not, then it won't work

Cheers

Sithik Sm

unread,
Feb 1, 2018, 7:36:10 AM2/1/18
to job-dsl-plugin
Hi Victor,

Yes I have repo plugin installed on my jenkins. Even i could able to create jobs, but I have job-dsl-review job which fails when i try to create with repoScm alone. Refer - https://github.com/sheehan/job-dsl-gradle-example/issues/94. This is the issue which I am facing now. 

Sithik Sm

unread,
Feb 7, 2018, 3:18:01 AM2/7/18
to job-dsl-plugin
Anyone can help to address this issue? Why this error is seen when executing with gradle?

Victor Martinez

unread,
Feb 7, 2018, 4:30:25 AM2/7/18
to job-dsl-plugin

Sithik Sm

unread,
Feb 7, 2018, 9:00:45 AM2/7/18
to job-dsl-plugin
Yeah I tried to add those dependencies but didnt help. Not sure exactly what is missing and what dependencies to be added to have repoScm.
Reply all
Reply to author
Forward
0 new messages