Improve meta gathering

This commit is contained in:
Dan Hawkins 2018-11-22 10:40:37 +00:00
commit fdea15232d

View file

@ -7,18 +7,18 @@ def getGitRevision(String gitrootpath, int basebuildnumber) {
dir( gitrootpath) {
def int MAXVERSIONNUMBER = 65535
def int changecount = sh(returnStdout: true, script: "${GIT_EXECUTABLE} rev-list HEAD --count").trim()
def int changecount = sh(returnStdout: true, script: "git rev-list HEAD --count").trim()
echo "Change count: ${changecount}"
adjustedchangecount = (changecount + basebuildnumber) % (MAXVERSIONNUMBER + 1)
echo "Adjusted change count: ${adjustedchangecount}"
gitrevision = sh(returnStdout: true, script: "${GIT_EXECUTABLE} rev-parse HEAD").trim()
gitrevision = sh(returnStdout: true, script: "git rev-parse HEAD").trim()
echo "Revision: ${gitrevision}"
remoteinfo = sh(returnStdout: true, script: "${GIT_EXECUTABLE} remote show origin").trim()
remoteinfo = sh(returnStdout: true, script: "git remote show origin").trim()
echo "Remote info: ${remoteinfo}"
remoteurl = sh(returnStdout: true, script: "${GIT_EXECUTABLE} remote get-url --push origin").trim()
remoteurl = sh(returnStdout: true, script: "git remote get-url --push origin").trim()
echo "Remote URL: ${remoteurl}"
}
return [adjustedchangecount, gitrevision, remoteinfo, remoteurl]