Discussion:
Trying to figure out how to disable concurrent builds in a scripted pipeline with inline parameters
David Karr
2018-07-03 21:17:04 UTC
Permalink
I have a scripted pipeline. I'm trying to figure out how to disable
concurrent builds. The job parameters are defined in the pipeline script.
All the examples I've seen are doing this in a declarative pipeline. I've
tried every variation I can of calling "disableConcurrentBuilds()", and
nothing has worked. It either fails with various syntax or semantic
errors, or it just ignores it. Are there any real examples of doing this in
a scripted pipeline anywhere?
--
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/6751a57f-df5a-4c1b-841f-2749a87ee2be%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Steven Foster
2018-07-03 21:33:58 UTC
Permalink
Are you putting it inside the properties step, such as

properties([
disableConcurrentBuilds()
])

I only use declarative so I don't know if that's 100% correct, but it
should work something like that from my understanding
Post by David Karr
I have a scripted pipeline. I'm trying to figure out how to disable
concurrent builds. The job parameters are defined in the pipeline script.
All the examples I've seen are doing this in a declarative pipeline. I've
tried every variation I can of calling "disableConcurrentBuilds()", and
nothing has worked. It either fails with various syntax or semantic
errors, or it just ignores it. Are there any real examples of doing this in
a scripted pipeline anywhere?
--
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/87057ef1-4d7f-414e-96d4-810fc07ce80b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
David Karr
2018-07-03 23:16:46 UTC
Permalink
Post by Steven Foster
Are you putting it inside the properties step, such as
properties([
disableConcurrentBuilds()
])
I only use declarative so I don't know if that's 100% correct, but it
should work something like that from my understanding
Fortunately, we managed to finally find the variation that works. We
already had a "properties" block, and we had to figure out how to integrate
it into that one properties block, instead of adding a separate one.
Getting the proper orientation of nesting levels is what we needed to
figure out. Some variations didn't fail with syntax errors, just confusing
runtime errors.
Post by Steven Foster
Post by David Karr
I have a scripted pipeline. I'm trying to figure out how to disable
concurrent builds. The job parameters are defined in the pipeline script.
All the examples I've seen are doing this in a declarative pipeline. I've
tried every variation I can of calling "disableConcurrentBuilds()", and
nothing has worked. It either fails with various syntax or semantic
errors, or it just ignores it. Are there any real examples of doing this in
a scripted pipeline anywhere?
--
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/0d305d56-3aa7-4561-bd3d-34a8c1104983%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...