aboutsummaryrefslogtreecommitdiff
path: root/jenkins/bisect.jpl
diff options
context:
space:
mode:
authorGuillaume Tucker <guillaume.tucker@collabora.com>2017-11-14 14:02:19 +0000
committerGuillaume Tucker <guillaume.tucker@collabora.com>2018-01-16 10:32:40 +0000
commit15941998646de32cf96b68886809f82a3bd5bd84 (patch)
tree4e57ff2db19761cd348fa2d16d08fb8c66091959 /jenkins/bisect.jpl
parenteaafbc2ab2f7ea88d4e72664939a8b3033710599 (diff)
bisect.jpl: create a temporary unique tag for each build
As configuration options and patches may be used in specific bisection jobs, and to find boot jobs in LAVA for a given bisection, create a temporary tag which will result in a unique git describe string. This way, each build and boot from bisection jobs is unique and not confused with previous runs on the same bisection range. Also remove any tag left behind by previously aborted jobs before starting the bisection. They can be found by searching for the Jenkins job name. Signed-off-by: Guillaume Tucker <guillaume.tucker@collabora.com>
Diffstat (limited to 'jenkins/bisect.jpl')
-rw-r--r--jenkins/bisect.jpl26
1 files changed, 24 insertions, 2 deletions
diff --git a/jenkins/bisect.jpl b/jenkins/bisect.jpl
index 0884bc7..1a2f214 100644
--- a/jenkins/bisect.jpl
+++ b/jenkins/bisect.jpl
@@ -39,6 +39,23 @@ def gitDescribe(kdir) {
return describe
}
+def createTag(kdir, iteration) {
+ def tag = gitDescribe(kdir)
+
+ dir(kdir) {
+ tag += "-${env.JOB_NAME}-${currentBuild.number}-${iteration}"
+ sh(script: "git tag -a ${tag} -m ${tag} HEAD")
+ }
+
+ return tag
+}
+
+def removeTag(kdir, tag) {
+ dir(kdir) {
+ sh(script: "git tag -d ${tag}")
+ }
+}
+
def cloneKCIBuild(kci_build) {
sh(script: "rm -rf ${kci_build}")
dir("${kci_build}") {
@@ -75,6 +92,7 @@ git clean -fd
git bisect reset || echo
git checkout --detach HEAD
git branch -D ${params.KERNEL_BRANCH} || echo
+for t in \$(git tag -l | grep ${env.JOB_NAME}); do git tag -d \$t; done
git fetch ${params.TREE} ${params.KERNEL_BRANCH} --tags
git checkout FETCH_HEAD -b ${params.KERNEL_BRANCH}
git symbolic-ref HEAD refs/heads/${params.KERNEL_BRANCH}
@@ -268,10 +286,10 @@ Bad: ${params.BAD_COMMIT}"""
def iteration = 1
while (previous != current) {
- def describe = gitDescribe(kdir)
+ def tag = createTag(kdir, iteration)
def status
- echo "Iteration #${iteration}: ${describe}"
+ echo "Iteration #${iteration}: ${tag}"
lock("${env.NODE_NAME}-build-lock") {
timeout(time: 60, unit: 'MINUTES') {
@@ -282,6 +300,8 @@ Bad: ${params.BAD_COMMIT}"""
}
if (!status) {
+ def describe = gitDescribe(kdir)
+
node("kernel-boot-v2") {
timeout(time: 120, unit: 'MINUTES') {
stage("Test ${iteration}") {
@@ -294,6 +314,8 @@ Bad: ${params.BAD_COMMIT}"""
}
}
+ removeTag(kdir, tag)
+
timeout(time: 5, unit: 'MINUTES') {
stage("Next") {
bisectNext(kdir, status)