[WorkFlow plugin] Parameterized Build

933 views
Skip to first unread message

El alaoui Mohamed Reda

unread,
Dec 23, 2014, 5:54:19 AM12/23/14
to jenkins...@googlegroups.com
Hello,
i have à workflow job and i need to have a choice list before start the build
How can i have a Parameterized Build with workflow (String or choice list ....)
thank's

--

Mohamed Reda, El alaoui


El alaoui Mohamed Reda

unread,
Dec 23, 2014, 6:03:58 AM12/23/14
to jenkins...@googlegroups.com
sorry for this mail i have the solution 

it's by the  : input

El alaoui Mohamed Reda

unread,
Dec 23, 2014, 6:25:16 AM12/23/14
to jenkins...@googlegroups.com
When i generate the groovy code with Snippet Generator to do input list parameters like this :

input id: 'Server', message: 'Choose the server', ok: 'Proceed', parameters: [[$class: 'ChoiceParameterDefinition', choices: ['Dev', 'Integ', 'Prod'], description: '', name: 'Server']]


i have this Error :

java.lang.ClassCastException: hudson.model.ChoiceParameterDefinition.choices expects class java.lang.String but received class java.util.ArrayList
	at org.jenkinsci.plugins.workflow.structs.DescribableHelper.coerce(DescribableHelper.java:197)
	at org.jenkinsci.plugins.workflow.structs.DescribableHelper.buildArguments(DescribableHelper.java:133)
	at org.jenkinsci.plugins.workflow.structs.DescribableHelper.instantiate(DescribableHelper.java:81)
	at org.jenkinsci.plugins.workflow.structs.DescribableHelper.coerce(DescribableHelper.java:183)
	at org.jenkinsci.plugins.workflow.structs.DescribableHelper.mapList(DescribableHelper.java:209)
	at org.jenkinsci.plugins.workflow.structs.DescribableHelper.coerce(DescribableHelper.java:195)
	at org.jenkinsci.plugins.workflow.structs.DescribableHelper.buildArguments(DescribableHelper.java:133)
	at org.jenkinsci.plugins.workflow.structs.DescribableHelper.injectSetters(DescribableHelper.java:254)
	at org.jenkinsci.plugins.workflow.structs.DescribableHelper.instantiate(DescribableHelper.java:83)
	at org.jenkinsci.plugins.workflow.steps.StepDescriptor.newInstance(StepDescriptor.java:95)
	at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:134)
	at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:98)
	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:45)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
	at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:15)
	at WorkflowScript.run(WorkflowScript:20)
	at Unknown.Unknown(Unknown)
	at ___cps.transform___(Native Method)
	at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:69)
	at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:100)
	at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:76)
	at sun.reflect.GeneratedMethodAccessor519.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
	at com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.dispatch(CollectionLiteralBlock.java:55)
	at com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.item(CollectionLiteralBlock.java:45)
	at sun.reflect.GeneratedMethodAccessor213.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
	at com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.dispatch(CollectionLiteralBlock.java:55)
	at com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.item(CollectionLiteralBlock.java:45)
	at sun.reflect.GeneratedMethodAccessor213.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
	at com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.dispatch(CollectionLiteralBlock.java:55)
	at com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.item(CollectionLiteralBlock.java:45)
	at sun.reflect.GeneratedMethodAccessor213.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
	at com.cloudbees.groovy.cps.impl.ConstantBlock.eval(ConstantBlock.java:21)
	at com.cloudbees.groovy.cps.Next.step(Next.java:58)
	at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:145)
	at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:164)
	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:267)
	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$000(CpsThreadGroup.java:70)
	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:176)
	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:174)
	at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:47)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:111)
	at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
	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)
Finished: FAILURE

Daniel Beck

unread,
Dec 23, 2014, 6:36:15 AM12/23/14
to jenkins...@googlegroups.com
See https://issues.jenkins-ci.org/browse/JENKINS-26143
> --
> 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-use...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAE-yB-PEeuC1FSBqfX2MNXXxoMM7RYquE28CpW4uwfXXz2aVOg%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

El alaoui Mohamed Reda

unread,
Dec 23, 2014, 6:52:12 AM12/23/14
to jenkins...@googlegroups.com
thank you Daniel.

I have other question : in the jenkins workflow plugin all interaction will remains in the output job console ? we will don't have a UI interaction in the future with workflow ?

best regards


For more options, visit https://groups.google.com/d/optout.

Jesse Glick

unread,
Jan 7, 2015, 6:44:01 PM1/7/15
to jenkins...@googlegroups.com
On Tuesday, December 23, 2014 6:52:12 AM UTC-5, Capfo wrote:
in the jenkins workflow plugin all interaction will remains in the output job console ? we will don't have a UI interaction in the future with workflow ?

When a flow build is waiting for input, a link is added to its sidepanel that takes you to the same UI page as the link from the console when using the ‘parameters’ option. (For ‘input’ without ‘parameters’ you can also proceed/abort directly from the console log as a convenience.)

If you are using Jenkins Enterprise by CloudBees, the tabular “stage” view includes direct support for the ‘input’ step.
Reply all
Reply to author
Forward
0 new messages