Read list of GitStep from inside a Project

5 views
Skip to first unread message

felipe...@gmail.com

unread,
Feb 18, 2019, 2:13:57 AM2/18/19
to Jenkins Developers
Hi,

I am looking for a way to read the list of GitStep from within a Project instance (or Job, or Queue.Item), similar to what Project.getBuilders() provides you.

Then I could access the user-defined inputs such as branches to track and repo url.

This seems possible by adding a dependency on Git plugin, and using Revision/Branch objects. (I haven't followed this route yet, as I am trying to avoid such dependency).

Thanks


Jesse Glick

unread,
Feb 18, 2019, 11:39:48 AM2/18/19
to Jenkins Dev
On Mon, Feb 18, 2019 at 2:13 AM <felipe...@gmail.com> wrote:
> I am looking for a way to read the list of GitStep from within a Project instance (or Job, or Queue.Item), similar to what Project.getBuilders() provides you.

Not exactly possible for Pipeline projects (since the exact steps may
vary from build to build) but you can use

https://javadoc.jenkins.io/jenkins/triggers/SCMTriggerItem.SCMTriggerItems.html#asSCMTriggerItem-hudson.model.Item-

which would reflect the last successful build.
Reply all
Reply to author
Forward
0 new messages