ELGIP-20 edits to allow use on windows
This commit is contained in:
parent
16a7f88ec3
commit
b8a0e604f1
1 changed files with 28 additions and 28 deletions
|
|
@ -10,43 +10,43 @@ def getGitRevision(String gitrootpath, int basebuildnumber) {
|
|||
def String remoteinfo
|
||||
def String remoteurl
|
||||
dir( gitrootpath) {
|
||||
|
||||
if (isUnix()) {
|
||||
def int changecount = sh(returnStdout: true, script: "git rev-list HEAD --count").trim()
|
||||
def int changecount
|
||||
if (isUnix()) {
|
||||
changecount = sh(returnStdout: true, script: "git rev-list HEAD --count").trim()
|
||||
}
|
||||
else {
|
||||
def stdout = bat(returnStdout:true , script: "git rev-list HEAD --count").trim()
|
||||
def int changecount = stdout.readLines()[1] as int
|
||||
}
|
||||
else {
|
||||
def stdout = bat(returnStdout:true , script: "git rev-list HEAD --count").trim()
|
||||
changecount = stdout.readLines()[1] as int
|
||||
}
|
||||
echo "Change count: ${changecount}"
|
||||
adjustedchangecount = (changecount + basebuildnumber) % (maxversionnumber() + 1)
|
||||
echo "Adjusted change count: ${adjustedchangecount}"
|
||||
|
||||
if (isUnix()) {
|
||||
|
||||
if (isUnix()) {
|
||||
gitrevision = sh(returnStdout: true, script: "git rev-parse HEAD").trim()
|
||||
}
|
||||
else {
|
||||
def stdout = bat(returnStdout:true , script: "git rev-parse HEAD").trim()
|
||||
gitrevision = stdout.readLines()[1] as int
|
||||
}
|
||||
}
|
||||
else {
|
||||
def stdout = bat(returnStdout:true , script: "git rev-parse HEAD").trim()
|
||||
gitrevision = stdout.readLines()[1]
|
||||
}
|
||||
echo "Revision: ${gitrevision}"
|
||||
|
||||
if (isUnix()) {
|
||||
|
||||
if (isUnix()) {
|
||||
remoteinfo = sh(returnStdout: true, script: "git remote show origin").trim()
|
||||
}
|
||||
else {
|
||||
def stdout = bat(returnStdout:true , script: "git remote show origin").trim()
|
||||
remoteinfo = stdout.readLines()[1] as int
|
||||
}
|
||||
}
|
||||
else {
|
||||
def stdout = bat(returnStdout:true , script: "git remote show origin").trim()
|
||||
remoteinfo = stdout.readLines()[1..-1]
|
||||
}
|
||||
echo "Remote info: ${remoteinfo}"
|
||||
|
||||
if (isUnix()) {
|
||||
|
||||
if (isUnix()) {
|
||||
remoteurl = sh(returnStdout: true, script: "git config --get remote.origin.url").trim()
|
||||
}
|
||||
else {
|
||||
def stdout = bat(returnStdout:true , script: "git config --get remote.origin.ur").trim()
|
||||
remoteurl = stdout.readLines()[1] as int
|
||||
}
|
||||
}
|
||||
else {
|
||||
def stdout = bat(returnStdout:true , script: "git config --get remote.origin.url").trim()
|
||||
remoteurl = stdout.readLines()[1]
|
||||
}
|
||||
echo "Remote URL: ${remoteurl}"
|
||||
}
|
||||
return [adjustedchangecount, gitrevision, remoteinfo, remoteurl]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue