Parse XML file within workspace to auto populate dynamic parameter

37 views
Skip to first unread message

Joyce Gaoiran

unread,
Sep 10, 2015, 1:13:19 PM9/10/15
to Jenkins Developers
I have an XML file located in the jobs workspace.  The XML file needs to be parsed for a version and displayed as a dynamic parameter.  I have several jobs which has the requirement so I've used the plugin, Extensible Choice Parameter, as an extension point.  Is there a class within the jenkins api which can be used to access/determine the workspace before the build has started?

Oleg Nenashev

unread,
Sep 27, 2015, 5:07:04 PM9/27/15
to Jenkins Developers
Hi Joice,

It is not possible at all. Workspace in builds is being determined according to many logic handlers including build params. You cannot foresee the workspace before the build starts. It is possible to get a workspace of the previous build, but such approach is error-prone as well.

A general recommendation would be to publish XML files as artifacts and take them as sources

четверг, 10 сентября 2015 г., 20:13:19 UTC+3 пользователь Joyce Gaoiran написал:
Reply all
Reply to author
Forward
0 new messages