Getting all workspace paths

29 views
Skip to first unread message

Artur Szostak

unread,
Aug 29, 2017, 10:22:09 AM8/29/17
to Jenkins Developers
Hello,

How is one supposed to get the workspaces produced by multiple runs of a job if it is allowed to execute builds concurrently? For example, a job called myjob will have workspaces myjob, myjob@2, myjob@3 etc for 3 concurrent builds. There are plenty of examples that indicate to use getWorkspaceFor from hudson.model.Node. But the API only returns one workspace, not all workspaces for all concurrent builds. Is the API broken?

Kind regards.

Artur

Jesse Glick

unread,
Sep 5, 2017, 6:10:39 PM9/5/17
to Jenkins Dev
You would have to append the suffix yourself. Probably you should not be attempting this to begin with. Consider cloud agents with transient workspaces, etc. What are you ultimately trying to accomplish?

Artur Szostak

unread,
Sep 6, 2017, 11:04:09 AM9/6/17
to Jenkins Dev
I am trying to clean up multiple workspaces created by a job that is allowed to run concurrently on a dumb node.
I see no consistent facility to cleanup all the workspaces in the GUI. Thus, I need to script it. But now I see that the API is inconsistent also.
OK, I will have to try guess the paths then, and hope I am right.

Is there any way for the secondary workspaces not to get a @<number> suffix? i.e. what other suffices do I have to look out for?

Cheers

Artur
________________________________________
From: jenkin...@googlegroups.com <jenkin...@googlegroups.com> on behalf of Jesse Glick <jgl...@cloudbees.com>
Sent: 06 September 2017 00:10:34
To: Jenkins Dev
Subject: Re: Getting all workspace paths

You would have to append the suffix yourself. Probably you should not be attempting this to begin with. Consider cloud agents with transient workspaces, etc. What are you ultimately trying to accomplish?

--
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<mailto:jenkinsci-de...@googlegroups.com>.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr3SvPwq%2BkrSFGoV%3DNJj9CgGGfuV-NAcYeAEdEg1Gd_dWA%40mail.gmail.com<https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr3SvPwq%2BkrSFGoV%3DNJj9CgGGfuV-NAcYeAEdEg1Gd_dWA%40mail.gmail.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.

Jesse Glick

unread,
Sep 6, 2017, 6:24:24 PM9/6/17
to Jenkins Dev
On Wed, Sep 6, 2017 at 11:03 AM, Artur Szostak <aszo...@partner.eso.org> wrote:
> I am trying to clean up multiple workspaces created by a job that is allowed to run concurrently on a dumb node.
> I see no consistent facility to cleanup all the workspaces in the GUI.

JENKINS-2111 and have fun following the chains of linked issues.
Reply all
Reply to author
Forward
0 new messages