Rather than check out a release repo to see if it exists or not use git ls-remote to establish if it exists

This commit is contained in:
Dan Hawkins 2019-05-03 15:29:15 +01:00
commit 7a62550a07

View file

@ -115,7 +115,7 @@ def gitCheckout(String gitURL, String revision, String targetDir, String repoRoo
}
def checkRepoExists(String gitURL) {
def boolean result = false
def int result = 0
if (isUnix()) {
result = sh( script: """
git ls-remote "${gitURL}" CHECK_GIT_REMOTE_URL_REACHABILITY
@ -129,7 +129,7 @@ def checkRepoExists(String gitURL) {
returnStatus: true
)
}
if (!result) {
if (result > 0) {
echo "git ls-remote return result: ${result}"
error("The release repo: ${gitURL} cannot be found. Please ensure this exists before building")
}