Discussion:
DSL for Choice Parameter
jhavero
2016-10-07 15:58:41 UTC
Permalink
Does anyone know the DSL for the Choice parameter for a promote. See
attached screenshot.

So far I have,

promotion {
name('promote')
icon('gold-blue-e')
// Promote
conditions {
manual(promote_users)
}
--
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+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/2378f181-1235-4009-9505-00d7a08ed3ac%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Victor Martinez
2016-10-07 16:03:38 UTC
Permalink
Hi there,


If you are talking about the jobdsl plugin:

What version of the jobdsl plugin do you use?

If you use 1.48+, if i recall correctly then you can use the autogenerated dsl documentation within your jenkins instance, further details:

https://github.com/jenkinsci/job-dsl-plugin/wiki/Automatically-Generated-DSL


Otherwise you might need to use the configure closure.

Cheers
--
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+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/a866cd7a-b645-4bad-a1ab-c92aa4bdc348%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
jhavero
2016-10-07 17:04:45 UTC
Permalink
I am using jobdsl plugin 1.47. How does configure closure work.
Post by Victor Martinez
Hi there,
What version of the jobdsl plugin do you use?
If you use 1.48+, if i recall correctly then you can use the autogenerated
https://github.com/jenkinsci/job-dsl-plugin/wiki/Automatically-Generated-DSL
Otherwise you might need to use the configure closure.
Cheers
--
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+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/aeee99a7-3f56-4282-aae7-ee695a78e9ef%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
jhavero
2016-10-07 17:48:27 UTC
Permalink
I have it close to work with the code below, however the list of choices -
a, b, c - do not appear as options in the generated job. The parameter name
'myParameterName' and description 'my description' does appear correctly.

promotion {
name('Promote')
icon('star-blue-e')
//
conditions {
manual(promote_users, parameters {
choiceParam('myParameterName', ['a', 'b', 'c'], 'my
description')
})
}
Post by jhavero
I am using jobdsl plugin 1.47. How does configure closure work.
Post by Victor Martinez
Hi there,
What version of the jobdsl plugin do you use?
If you use 1.48+, if i recall correctly then you can use the
autogenerated dsl documentation within your jenkins instance, further
https://github.com/jenkinsci/job-dsl-plugin/wiki/Automatically-Generated-DSL
Otherwise you might need to use the configure closure.
Cheers
--
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+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/3a25bbcb-afc7-4385-9ca7-a18934fabb3e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Victor Martinez
2016-10-07 22:17:28 UTC
Permalink
That DSL is implemented as part of the promotoon plugin itself:
- https://github.com/jenkinsci/promoted-builds-plugin#job-dsl-support

Therefore you can use the choiceParam as suggested in the below link:
- https://jenkinsci.github.io/job-dsl-plugin/#method/javaposse.jobdsl.dsl.helpers.BuildParametersContext.choiceParam

Besides of that, there is likely a bug in your snippet:

conditions {
manual(promote_users, parameters {
choiceParam('myParameterName', ['a', 'b', 'c'], 'my
description')
}*)*

Cheers
Post by jhavero
I have it close to work with the code below, however the list of choices -
a, b, c - do not appear as options in the generated job. The parameter name
'myParameterName' and description 'my description' does appear correctly.
promotion {
name('Promote')
icon('star-blue-e')
//
conditions {
manual(promote_users, parameters {
choiceParam('myParameterName', ['a', 'b', 'c'], 'my
description')
})
}
Post by jhavero
I am using jobdsl plugin 1.47. How does configure closure work.
Post by Victor Martinez
Hi there,
What version of the jobdsl plugin do you use?
If you use 1.48+, if i recall correctly then you can use the
autogenerated dsl documentation within your jenkins instance, further
https://github.com/jenkinsci/job-dsl-plugin/wiki/Automatically-Generated-DSL
Otherwise you might need to use the configure closure.
Cheers
--
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+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/85b9e65e-bb35-40d1-855f-1616c7e9387c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Continue reading on narkive:
Loading...