Merge "Check if DEBIAN_BRANCH exists in build-debian-packages-pipeline"
diff --git a/build-debian-packages-pipeline.groovy b/build-debian-packages-pipeline.groovy
index 4220b7a..8bfbff6 100644
--- a/build-debian-packages-pipeline.groovy
+++ b/build-debian-packages-pipeline.groovy
@@ -64,7 +64,15 @@
scm: [$class: 'GitSCM', branches: pollBranches, doGenerateSubmoduleConfigurations: false,
extensions: extensions, submoduleCfg: [], userRemoteConfigs: userRemoteConfigs]
if (debian_branch){
- sh("git checkout "+DEBIAN_BRANCH)
+ /* There are 2 schemas of build spec keeping:
+ 1. Separate branch with build specs. I.e. debian/xenial
+ 2. Separate directory with specs.
+ Logic below makes package build compatible with both schemas.
+ */
+ def retStatus = sh(script: 'git checkout ' + DEBIAN_BRANCH, returnStatus: true)
+ if (retStatus != 0) {
+ common.warningMsg("Cannot checkout ${DEBIAN_BRANCH} branch. Going to build package by ${SOURCE_BRANCH} branch.")
+ }
}
}
debian.cleanup(OS+":"+DIST)