Hi there,
On 09/12/15 23:40, Guy Matz wrote:
> Hi! Anyone know how I can retrieve the git revision from a job?
>
> I can get to the build:
>
> j = Jenkins.instance.getJob('render-master')
> b475 = j.getBuildByNumber(475)
>
> but I can't find a way to to get the git revision associated with that
> build. Any thoughts would be appreciated!
Git metadata is stored in a `BuildData` action, so something like this
(untested) should work:
b475.getAction(hudson.plugins.git.util.BuildData.class).lastBuiltRevision.sha1String
Regards,
Chris
--
You received this message because you are subscribed to the Google Groups
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/5668C714.30504%40orr.me.uk.
For more options, visit https://groups.google.com/d/optout.