Merge remote-tracking branch 'origin/master' into production

This commit is contained in:
Dan Hawkins 2019-05-05 09:33:36 +01:00
commit 04384bd46e
2 changed files with 24 additions and 1 deletions

View file

@ -4,7 +4,7 @@ vc = load("${autobuilder.commonscripts()}/versioncontrol/git.groovy")
// Prove the existence of the release repo - otherwise there is a large wait to cycle the build to correct the meta data
def registerrepo(meta, String releaserepo, String repoRootSuffix = "") {
if (releaserepo?.trim()) {
vc.gitCheckout(releaserepo, "origin/master", "tmp/releaserepo", repoRootSuffix)
vc.checkRepoExists(releaserepo)
}
meta.releaseinfo.set(releaserepo)
}

View file

@ -114,6 +114,29 @@ def gitCheckout(String gitURL, String revision, String targetDir, String repoRoo
])
}
def checkRepoExists(String gitURL) {
def int result = 0
if (isUnix()) {
result = sh( script: """
git ls-remote "${gitURL}" CHECK_GIT_REMOTE_URL_REACHABILITY
""",
returnStatus: true
)
} else {
result = bat( script: """
@git ls-remote "${gitURL}" CHECK_GIT_REMOTE_URL_REACHABILITY
""",
returnStatus: true
)
}
echo "git ls-remote return result: ${result}"
if (result > 0) {
error("The release repo: ${gitURL} cannot be found. Please ensure this exists before building")
} else {
echo "The release repo: ${gitURL} exists"
}
}
String getSHAFromVersion(String versionFolder) {
dir (versionFolder) {
srcRevision = readFile("gitrevision.txt").trim()