Plugin question: how to access scm info from a GraphListener

17 views
Skip to first unread message

jxpe...@godaddy.com

unread,
Sep 29, 2017, 4:48:17 PM9/29/17
to Jenkins Developers
We have some shared library code that calls github hooks to provide detailed status about which stages in our pipelines have completed on our PR pages. 

In Groovy, we can get the hook by calling workflow.scm.getUserRemoteConfigs()[0].getUrl())

I'm looking at writing a plugin that does the same thing to simplify our pipeline code, and it seems like GraphListener is the right extension.
I have a plugin that can figure out when stages start and stop, however I can't figure out how to get access to the scm config to get the right URL to call.
Can someone point me in the right direction? I don't know whether I need to implement another extension or whether it's available somehow from the FlowNode.

Thanks
Jeff

Jesse Glick

unread,
Sep 29, 2017, 4:56:12 PM9/29/17
to Jenkins Dev
You can look up `SCMRevisionAction` on the `Run`, if you are
interested in the `scm` of a multibranch project.

Also cf. JENKINS-46170.

Jeff Pearce

unread,
Oct 2, 2017, 3:02:21 PM10/2/17
to jenkin...@googlegroups.com
Thanks Jesse.

That’s exactly what I was looking for.

Jeff
--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-dev/qsyoPXSLD5k/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr2xQqbGagCW%3D%2BmiEyVkG6ujbMT5cMxfhHV43uypvM9N_g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Reply all
Reply to author
Forward
0 new messages