Queuing build on a disabled agent

Is there a way to add a build to the queue for a specific agent, which is disabled, so that the build would start when the agent gets enabled later? I'm trying to do this specifically through the REST API.

 If I queue a job to a specific agent, the agent starts running the job regardless of being disabled or not.

 I'm trying to do this as a part of a workaround for not having "Trigger on all compatible agents" option on VCS triggers. First I used the old HTTP API, because it had the parameter agentId=allEnabledCompatible. That doesn't work thought, because it skips disabled agents. Then I tried using the REST API to get the list of all compatible agents and queuing the job for each agent individually. This does queue the job on disabled agents too, but it also runs them immediately. I'd like to queue the job on all compatible agents (both enabled and disabled), so that the job will run once the agent becomes idle and enabled. Is this doable?

0

Please sign in to leave a comment.