Improve meta gathering
This commit is contained in:
parent
1968cf408f
commit
fdea15232d
1 changed files with 4 additions and 4 deletions
|
|
@ -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]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue