I am using the jenkins-cli to run a groovy script:
https://github.com/jenkinsci/jenkins-scripts/blob/master/scriptler/disableEnableJobsMatchingPattern.groovy
& trying to pass these 2 parameters
1/ jobPattern=build_git_auto
2/ disableOrEnable=disable
Here is the command.
[jenkins@ip-10-0-0-92 scripts]$ java -jar jenkins-cli.jar
-noCertificateCheck -s https://10.0.0.91/ groovy
disableEnableJobsMatchingPattern.groovy jobPattern=build_git_auto
disableOrEnable=disable --username 12345 --password banana
Skipping HTTPS certificate checks altogether. Note that this is not secure
at all.
groovy.lang.MissingPropertyException: No such property: disableOrEnable for
class: RemoteClass
at
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:50)
at
org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:49)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:231)
at RemoteClass.run(RemoteClass:19)
at
groovy.lang.GroovyShell.runScriptOrMainOrTestOrRunnable(GroovyShell.java:266)
at groovy.lang.GroovyShell.run(GroovyShell.java:517)
at hudson.cli.GroovyCommand.run(GroovyCommand.java:94)
at hudson.cli.CLICommand.main(CLICommand.java:237)
at hudson.cli.CliManagerImpl.main(CliManagerImpl.java:92)
at sun.reflect.GeneratedMethodAccessor897.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at
hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:320)
at
hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:295)
at
hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:254)
at hudson.remoting.UserRequest.perform(UserRequest.java:121)
at hudson.remoting.UserRequest.perform(UserRequest.java:49)
at hudson.remoting.Request$2.run(Request.java:324)
at
hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
at hudson.cli.CliManagerImpl$1.call(CliManagerImpl.java:63)
at
hudson.remoting.CallableDecoratorAdapter.call(CallableDecoratorAdapter.java:18)
at
hudson.remoting.CallableDecoratorList$1.call(CallableDecoratorList.java:21)
at
jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
On Friday, March 22, 2013 at 1:33:04 PM UTC-7, Merrow, Frank wrote:
>
> So I am using Jenkins-cli to execute a groovy script in my Jenkins
> servers . . . works great.
>
>
>
> Except now I want to pass that groovy script a parameter . . .
>
>
>
> Does someone have some cleaver way of passing data into the Groovy script?
>
>
>
> Frank
>
--
You received this message because you are subscribed to the Google Groups
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/2c62dcdc-adcd-457e-ad32-e383819c2beb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.