If GIT_COMMIT is not providing what you want, then you can use an `sh` or
`bat` step to get the sha1 of the commit that is the HEAD of the working
repository.

See
https://github.com/MarkEWaite/jenkins-pipeline-utils/blob/fa3266f738f735e40581abfd9b6a226b3dac0ab6/pipelineSteps.groovy#L41
for an example.

Mark Waite



On Mon, Jan 14, 2019 at 12:40 PM Eldad Cohen <[email protected]> wrote:

> How to get GIT revision in a pipeline. All kind of post on variables does
> not match any case.
>
> --
> 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/262a2b3d-efac-4980-9607-5ae37712eb34%40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-users/262a2b3d-efac-4980-9607-5ae37712eb34%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Thanks!
Mark Waite

-- 
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/CAO49JtEWLiNOvui1RQDKyhKEudokV%2Bzum9yPMw%3D%2BGgZiKoOGjg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to