aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Galka <michal.galka@collabora.com>2019-10-02 22:34:06 +0200
committerGuillaume Tucker <guillaume.tucker@collabora.com>2019-10-30 10:34:39 +0000
commit49add8ef65e5c40bc51372f0d81394cfb997bfc9 (patch)
treec4e5c12e8c3a22a4c5441f79204dd7ca751f5494
parent3b40138f4f4e10887cfc2b70ed4a5c56c84a1bab (diff)
bisect.jpl: Use kci_build get_reference in the bisect job
Reference tree name, url and branch are now taken from kci_build get_reference. Job parameters can be used to override this values. Signed-off-by: Michal Galka <michal.galka@collabora.com>
-rw-r--r--jenkins/bisect.jpl30
1 files changed, 23 insertions, 7 deletions
diff --git a/jenkins/bisect.jpl b/jenkins/bisect.jpl
index f8eb68d..2c97630 100644
--- a/jenkins/bisect.jpl
+++ b/jenkins/bisect.jpl
@@ -381,7 +381,7 @@ def runTest(kci_core, describe, expected=0, runs=0) {
* bisection
*/
-def findMergeBase(kdir, good, bad) {
+def findMergeBase(kdir, kci_core, good, bad) {
def base = good
dir(kdir) {
@@ -390,16 +390,32 @@ def findMergeBase(kdir, good, bad) {
script: "git merge-base --is-ancestor ${base} HEAD")
if (good_base != 0) {
- def ref = "${params.REF_KERNEL_TREE}/${params.REF_KERNEL_BRANCH}"
+ def ref_url = params.REF_KERNEL_URL
+ def ref_tree = params.REF_KERNEL_TREE
+ def ref_branch = params.REF_KERNEL_BRANCH
+
+ if (!(ref_url && ref_tree && ref_branch)) {
+ dir(kci_core) {
+ ref_config = sh(script: """\
+ ./kci_build get_reference --tree-name ${params.KERNEL_TREE} \
+ --branch ${params.KERNEL_BRANCH}""", returnStdout: true).trim().tokenize("\n")
+ if (ref_config.size() > 0) {
+ ref_url = ref_config[0]
+ ref_tree = ref_config[1]
+ ref_branch = ref_config[2]
+ }
+ }
+ }
+ def ref = "${ref_tree}/${ref_branch}"
print("Good commit not in current branch, finding base in ${ref}")
print("""\
Reference:
- Tree: ${params.REF_KERNEL_TREE}
- URL: ${params.REF_KERNEL_URL}
- Branch: ${params.REF_KERNEL_BRANCH}""")
+ Tree: ${ref_tree}
+ URL: ${ref_url}
+ Branch: ${ref_branch}""")
- setRemote(kdir, params.REF_KERNEL_TREE, params.REF_KERNEL_URL)
+ setRemote(kdir, ref_tree, ref_url)
base = sh(script: "git merge-base ${bad} ${ref}",
returnStdout: true).trim()
print("Merge base: ${base}")
@@ -539,7 +555,7 @@ def bisection(kci_core, kdir, checks) {
}
bad = params.BAD_COMMIT
- good = findMergeBase(kdir, params.GOOD_COMMIT, bad)
+ good = findMergeBase(kdir, kci_core, params.GOOD_COMMIT, bad)
}
stage("Check pass") {