Merge commit 'e12939d928'
This commit is contained in:
commit
cd0a331140
2 changed files with 38 additions and 22 deletions
|
|
@ -61,7 +61,7 @@ def checkoutreleaserepo(buildmeta, String checkoutfolder) {
|
||||||
}
|
}
|
||||||
previousreleasemeta = getpreviousreleasemeta(buildmeta, checkoutfolder)
|
previousreleasemeta = getpreviousreleasemeta(buildmeta, checkoutfolder)
|
||||||
dir(checkoutfolder) {
|
dir(checkoutfolder) {
|
||||||
// Clear all existing files
|
// Clear all existing files - Note that this does not remove .git*
|
||||||
sh("git rm -r *")
|
sh("git rm -r *")
|
||||||
}
|
}
|
||||||
return previousreleasemeta
|
return previousreleasemeta
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,23 @@ def String checkouttoreporoot(String gitURL) {
|
||||||
return reporootsubfolder
|
return reporootsubfolder
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def checkgitlfsinstall() {
|
||||||
|
if (isUnix()) {
|
||||||
|
sh """
|
||||||
|
git lfs install
|
||||||
|
if [ \$? -ne 0 ]; then exit 1; fi
|
||||||
|
"""
|
||||||
|
|
||||||
|
} else {
|
||||||
|
bat """
|
||||||
|
git lfs install
|
||||||
|
if errorlevel 1 EXIT /b 1
|
||||||
|
"""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
def gitCheckout(String gitURL, String revision, String targetDir, String repoRootSuffix = "", int cloneDepth = 1, boolean shallowClone = true, ArrayList<String> sparseitemlist = new ArrayList<String>()) {
|
def gitCheckout(String gitURL, String revision, String targetDir, String repoRootSuffix = "", int cloneDepth = 1, boolean shallowClone = true, ArrayList<String> sparseitemlist = new ArrayList<String>()) {
|
||||||
|
checkgitlfsinstall()
|
||||||
def reporootpath = checkouttoreporoot(gitURL)
|
def reporootpath = checkouttoreporoot(gitURL)
|
||||||
checkout([
|
checkout([
|
||||||
$class: 'GitSCM',
|
$class: 'GitSCM',
|
||||||
|
|
@ -99,33 +115,33 @@ def gitCheckout(String gitURL, String revision, String targetDir, String repoRoo
|
||||||
}
|
}
|
||||||
|
|
||||||
String getSHAFromVersion(String versionFolder) {
|
String getSHAFromVersion(String versionFolder) {
|
||||||
dir (versionFolder) {
|
dir (versionFolder) {
|
||||||
srcRevision = readFile("gitrevision.txt").trim()
|
srcRevision = readFile("gitrevision.txt").trim()
|
||||||
}
|
}
|
||||||
return srcRevision
|
return srcRevision
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean checkAllVersionsAgree(java.util.LinkedHashMap versions) {
|
boolean checkAllVersionsAgree(java.util.LinkedHashMap versions) {
|
||||||
def keys = versions.keySet()
|
def keys = versions.keySet()
|
||||||
if (keys.size() < 1) {
|
if (keys.size() < 1) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
if (keys.size() == 1) {
|
if (keys.size() == 1) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
version = ""
|
version = ""
|
||||||
for (key in keys) {
|
for (key in keys) {
|
||||||
nextversion = versions.get(key)
|
nextversion = versions.get(key)
|
||||||
if (version == "") {
|
if (version == "") {
|
||||||
version = nextversion
|
version = nextversion
|
||||||
}
|
}
|
||||||
if (nextversion != version) {
|
if (nextversion != version) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
def stripgithistory(String rootfolder) {
|
def stripgithistory(String rootfolder) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue