Hold a build in the queue, and run it only after something happens
Answered
Hello,
I am developing a plugin which holds a build in the queue, calls an API (and keeps calling if it doesn't return what's intended to), and then runs it only after the API returns the intended response. I am having problems with the last part.
Initially, I was using requirements, so it would add a requirement that's impossible to meet, and then removing it; but it doesn't seem to work, and I don't know how to proceed. Do I have to use promotions? Or do I have to write the logic in the agent part of the plugin? How does it interact with the queue?
Thank you in advance,
João
Please sign in to leave a comment.
There are two extension points which you can use:
- jetbrains.buildServer.serverSide.buildDistribution.StartBuildPrecondition
- jetbrains.buildServer.serverSide.buildDistribution.StartingBuildAgentsFilter
The first one allows to prevent build from starting until some condition is met. The second one is more powerful (and is more complex to implement), as it allows blocking of a queued build start and reorder or filter agents which can start a build.