get all agents used by a build

39 views
Skip to first unread message

Mathieu DELROCQ

unread,
Apr 20, 2022, 4:03:21 AM4/20/22
to jenkin...@googlegroups.com
Hi all,

I have a Run object and I would like to get all agents used in this run.
Like described here, it is possible to run a Job on multiple agents by using Pipeline.

I know there is a NODE_NAME environment variable but what happens if there is multiple nodes instanciated for the Job ?


Thanks in advance.

Mathieu DELROCQ

Jesse Glick

unread,
Apr 20, 2022, 8:25:33 AM4/20/22
to jenkin...@googlegroups.com
On Wed, Apr 20, 2022 at 4:03 AM Mathieu DELROCQ <delrocq...@gmail.com> wrote:
I have a Run object and I would like to get all agents used in this run.

For `AbstractBuild` (traditional job types), there is a getter. For Pipeline (`FlowExecutionOwner.Executable`) you would need to iterate the `FlowNode`s looking for `WorkspaceAction` (this would be added to the block entry nodes for the `node` step).

Mathieu DELROCQ

unread,
Apr 20, 2022, 9:51:14 AM4/20/22
to jenkin...@googlegroups.com
Thank you I will try this !! :D

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr0hhKzUjUXg1qYxyUR-OcNkiKpbViV3yjtnJvLE8SL7JA%40mail.gmail.com.

Mathieu DELROCQ

unread,
Apr 22, 2022, 11:18:35 AM4/22/22
to jenkin...@googlegroups.com
It is working as expected. But now I'm trying to get the duration of the stage wich use the agent and I don't find a way to do that.
Do you have an idea ?

Thanks in advance.

Mathieu DELROCQ

Jesse Glick

unread,
Apr 22, 2022, 2:02:08 PM4/22/22
to jenkin...@googlegroups.com
On Fri, Apr 22, 2022 at 11:18 AM Mathieu DELROCQ <delrocq...@gmail.com> wrote:
get the duration of the stage wich use the agent

Reply all
Reply to author
Forward
0 new messages