Last active
August 29, 2019 03:04
-
-
Save yuriwally/6935a06716f8942d8ab2f930efca9bfd to your computer and use it in GitHub Desktop.
get git revision ( SHA ) using Jenkins API ( groovy version )
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def jobName = '' | |
| def buildNumber ='' | |
| Jenkins.instance | |
| .getItemByFullName(jobName) | |
| .getBuildByNumber(buildNumber) | |
| .getAction(jenkins.scm.api.SCMRevisionAction.class) | |
| .getRevision() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment