Improve meta gathering
This commit is contained in:
parent
cd12e5f558
commit
66cbeb949c
2 changed files with 15 additions and 11 deletions
|
|
@ -216,7 +216,7 @@ class MetaInfo extends GISJsonSerialised {
|
|||
for (configurationitem in configurationinfo) {
|
||||
configuration.add(configurationitem.serialisationdata())
|
||||
}
|
||||
return associated
|
||||
return configuration
|
||||
}
|
||||
|
||||
void addConfigurationInfo(String configurationname, String configurationURL, String configurationversion, String configurationSHA) {
|
||||
|
|
|
|||
|
|
@ -1,20 +1,24 @@
|
|||
|
||||
def getGitRevision(String gitrootpath, int basebuildnumber) {
|
||||
def int adjustedchangecount
|
||||
def String gitrevision
|
||||
def String remoteinfo
|
||||
def String remoteurl
|
||||
dir( gitrootpath) {
|
||||
def int MAXVERSIONNUMBER = 65535
|
||||
|
||||
def int changecount = sh(returnStdout: true, script: "${GIT_EXECUTABLE} rev-list HEAD --count")
|
||||
def int changecount = sh(returnStdout: true, script: "${GIT_EXECUTABLE} rev-list HEAD --count").trim()
|
||||
echo "Change count: ${changecount}"
|
||||
def int adjustedchangecount = (changecount + basebuildnumber) % (MAXVERSIONNUMBER + 1)
|
||||
adjustedchangecount = (changecount + basebuildnumber) % (MAXVERSIONNUMBER + 1)
|
||||
echo "Adjusted change count: ${adjustedchangecount}"
|
||||
|
||||
def gitrevision = sh(returnStdout: true, script: "${GIT_EXECUTABLE} rev-parse HEAD")
|
||||
gitrevision = sh(returnStdout: true, script: "${GIT_EXECUTABLE} rev-parse HEAD").trim()
|
||||
echo "Revision: ${gitrevision}"
|
||||
|
||||
def remoteinfo = sh(returnStdout: true, script: "${GIT_EXECUTABLE} remote show origin")
|
||||
remoteinfo = sh(returnStdout: true, script: "${GIT_EXECUTABLE} remote show origin").trim()
|
||||
echo "Remote info: ${remoteinfo}"
|
||||
|
||||
def remoteurl = sh(returnStdout: true, script: "${GIT_EXECUTABLE} remote get-url --push origin")
|
||||
remoteurl = sh(returnStdout: true, script: "${GIT_EXECUTABLE} remote get-url --push origin").trim()
|
||||
echo "Remote URL: ${remoteurl}"
|
||||
}
|
||||
return [adjustedchangecount, gitrevision, remoteinfo, remoteurl]
|
||||
|
|
@ -41,9 +45,7 @@ def getVersionPrefix(String sourcebranch) {
|
|||
return mastertypeversionprefix
|
||||
}
|
||||
|
||||
echo "sourcebranch is now: ${sourcebranch}"
|
||||
def splits2 = sourcebranch.split('\\.')
|
||||
echo "Splits2 is: ${splits2}"
|
||||
if (splits2.size() < 1) {
|
||||
def thirdpartyversionprefix = "1.25000.0."
|
||||
echo "Source branch name has no dots in it (eg. 1.9.2). Defaulting to: ${thirdpartyversionprefix}"
|
||||
|
|
@ -51,7 +53,6 @@ def getVersionPrefix(String sourcebranch) {
|
|||
}
|
||||
splits = []
|
||||
for (split in splits2) {
|
||||
echo "Split is: ${split}"
|
||||
if (split.isInteger()) {
|
||||
splits.add(split)
|
||||
}
|
||||
|
|
@ -59,7 +60,6 @@ def getVersionPrefix(String sourcebranch) {
|
|||
return mastertypeversionprefix
|
||||
}
|
||||
}
|
||||
echo "Splits is: ${splits}"
|
||||
|
||||
def versionprefix = ""
|
||||
if (splits.size() < 1) {
|
||||
|
|
@ -69,7 +69,6 @@ def getVersionPrefix(String sourcebranch) {
|
|||
else {
|
||||
def int splitnumbercount = 0
|
||||
for (split in splits) {
|
||||
echo "Split is ${split}"
|
||||
if (split.isInteger()) {
|
||||
versionprefix += split + "."
|
||||
splitnumbercount += 1
|
||||
|
|
@ -96,6 +95,11 @@ def getVersionPrefix(String sourcebranch) {
|
|||
}
|
||||
|
||||
String generate(meta, String sourcerevision, String sourcepath, int basebuildnumber = 1000) {
|
||||
def int gitrevisioncount
|
||||
def String gitrevision
|
||||
def String remoteinfo
|
||||
def String remoteurl
|
||||
|
||||
(gitrevisioncount, gitrevision, remoteinfo, remoteurl) = getGitRevision(sourcepath, basebuildnumber)
|
||||
|
||||
def versionprefix = getVersionPrefix(sourcerevision)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue