Multi branch and git hub organization project - pipeline Jenkins job

17 views
Skip to first unread message

Chandru

unread,
Aug 2, 2018, 9:45:24 AM8/2/18
to Jenkins Developers
Hi, currently am working in converting my freestyle plugin to pipeline support.
Can someone help me how to get scm details from RUN object.
Since multi-branch and GitHub organization jobs holders the scm details in initial configure page not sure how to extrxat the scm details. Also when I have Declarative syntax in my Jenkins file without any scm Details it automatically checkout the scm code as per the pipeline document. I want to know how I can get these scm details. Any help would be much appreciated.

Thank you!!

Jesse Glick

unread,
Aug 6, 2018, 10:50:48 AM8/6/18
to Jenkins Dev
On Thu, Aug 2, 2018 at 9:45 AM Chandru <chandru....@gmail.com> wrote:
> Can someone help me how to get scm details from RUN object.
> Since multi-branch and GitHub organization jobs holders the scm details in initial configure page not sure how to extrxat the scm details.

If you are specifically interested in multibranch, I think you can use

http://javadoc.jenkins.io/plugin/scm-api/jenkins/scm/api/SCMSource.SourceByItem.html#findSource-hudson.model.Item-

If you are given a simple Pipeline job (not part of a multibranch
folder), it is tricky since there may be no associated SCM, or many,
but you can check for those `checkout` steps run in the last completed
build:

http://javadoc.jenkins.io/jenkins/triggers/SCMTriggerItem.SCMTriggerItems.html#asSCMTriggerItem-hudson.model.Item-
Reply all
Reply to author
Forward
0 new messages