Manage waiting in a build step

One of my build steps detects a condition it must wait upon. If there are no builds in the queue, I'd like my build to sit there and wait for the condition. But if there are builds in the queue the build will be just sitting there doing nothing, so I'd like to stop it and add it on the back of the queue.

Is it possible to detect if there are builds in the queue from a build step?

Is it possible to stop a build and add it to the end of the queue if such a condition detected?

How?

1

Please sign in to leave a comment.