From 4d05492f43e9e471b3c3e82c49469de1a3359bd9 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Wed, 20 Sep 2017 12:08:24 +0100 Subject: [PATCH] use matching sytest branch, or develop --- jenkins/test-monolith.sh | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/jenkins/test-monolith.sh b/jenkins/test-monolith.sh index 344fdd3a..538447c1 100755 --- a/jenkins/test-monolith.sh +++ b/jenkins/test-monolith.sh @@ -13,12 +13,21 @@ rm -f sytest/server-*/*.log sytest/results.tap ./jenkins/prepare-dendrite.sh if [ ! -d "sytest" ]; then - git clone https://github.com/matrix-org/sytest.git --depth 1 --branch dendrite -else - git -C sytest fetch --depth 1 origin dendrite - git -C sytest reset --hard FETCH_HEAD + git clone https://github.com/matrix-org/sytest.git --depth 1 --branch master fi +# Jenkins may have supplied us with the name of the branch in the +# environment. Otherwise we will have to guess based on the current +# commit. +: ${GIT_BRANCH:="origin/$(git rev-parse --abbrev-ref HEAD)"} + +git -C sytest fetch --depth 1 origin "${GIT_BRANCH}" || { + echo >&2 "No ref ${GIT_BRANCH} found, falling back to develop" + git -C sytest fetch --depth 1 origin develop +} + +git -C sytest reset --hard FETCH_HEAD + ./sytest/jenkins/prep_sytest_for_postgres.sh ./sytest/jenkins/install_and_run.sh \