Trying to figure out how to disable concurrent builds in a scripted pipeline with inline parameters

384 views
Skip to first unread message

David Karr

unread,
Jul 3, 2018, 5:17:04 PM7/3/18
to Jenkins Users
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?

Steven Foster

unread,
Jul 3, 2018, 5:33:59 PM7/3/18
to Jenkins Users
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

David Karr

unread,
Jul 3, 2018, 7:16:47 PM7/3/18
to Jenkins Users


On Tuesday, July 3, 2018 at 2:33:59 PM UTC-7, Steven Foster wrote:
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.
 
Reply all
Reply to author
Forward
0 new messages