Custom build configuration

I have 20 build configurations which are based on a template and these 20 build configurations can run on any of the 10 agents available.

Now the requirement is, though these builds can run on any of the 10 available agents, only one build should be running at a time. I would like to know if this can be achieved. If yes, how?

7 comments
Comment actions Permalink

Hello Paul,

You can limit the number of simultaneously running builds on General Settings page of build configuration. If you set option "Limit the number of simultaneously running builds" to 1 the second build will be queued but not run until the first completes.

Kind regards,
Marina

0
Comment actions Permalink

Hello Marina,

Thanks for your reply. But my requirement is little different from what the option actually does. "Limit the number of simultaneously running builds" limits the same build from running simultaneously on different agents. My requirement is, only one build from the total 20 should be running at a time. One simple way to achieve this is, restricting the build configuration to run on only one agent. But I don't want the builds to be dependent on a single agent. I know it sounds bit complicated but it would be nice if someone could help me out on this.

Thanks,
Paul

0
Comment actions Permalink

Paul,

Can you please describe what use case you need the feature for?

Also take a look at Groovy plugin: http://www.jetbrains.net/confluence/display/TW/Groovy+plug. It supports read/write locks, i.e. you can take same write lock in Build A and Build B, in this case only one build of them will be running.



Please also watch/vote for the feature request "Do not to start a build while a particular build configuration has builds running".

Kind regards,
Marina
0
Comment actions Permalink

Thanks a lot Marina, I think Groovy plugin will do the job for me. But would like to know if there is a sample on how to configure and use it which would really help.

My use case is better described in http://youtrack.jetbrains.net/issue/TW-3798

Thanks again for your prompt reply.

0
Comment actions Permalink

Paul,

Add system property to all of configurations: "system.locks.writeLock.<lockName>" where <lockName> is the name of the shared resource. Then when each configuration starts it will acquire write lock with given name. If another configuration already locked this resource, configuration will wait for the build of other configuration to finish.



Also please vote for the issue http://youtrack.jetbrains.net/issue/TW-3798.

Kind regards,
Marina
0
Comment actions Permalink

Fantastic! That worked like a charm. Thank you very much for your timely help!

Thanks,
Paul

0
Comment actions Permalink

Glad I could help :)

Kind regards,

Marina

0

Please sign in to leave a comment.