From 373c3509204f5c9bdecf3af3c5690676e7bce354 Mon Sep 17 00:00:00 2001 From: Boaz Leskes Date: Tue, 6 Dec 2016 09:43:28 +0100 Subject: [PATCH] ci: accommodate for repo name to be part of `GIT_BRANCH` It seems that that variable is set by the git jenkins plugin and it's format is `origin/master`. See https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin#GitPlugin-Environmentvariables Original commit: elastic/x-pack-elasticsearch@17f8ec1a9e322a0f1061884a6d3ae31ce01b5df1 --- dev-tools/ci | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dev-tools/ci b/dev-tools/ci index d34b046b6cf..f48c7f7fa66 100755 --- a/dev-tools/ci +++ b/dev-tools/ci @@ -69,7 +69,8 @@ if [ -z ${USE_EXISTING_ES:+x} ]; then exit 1 fi # AWAITSFIX: the fallback to master should be removed, see https://github.com/elastic/infra/issues/1557 - BRANCH=${PR_SOURCE_BRANCH:-${GIT_BRANCH:-master}} # fall back to CI branch if not testing a PR + BRANCH=${PR_SOURCE_BRANCH:-${GIT_BRANCH#/}} # GIT_BRANCH starts with the repo, i.e., origin/master + BRANCH=${BRANCH:-master} # fall back to CI branch if not testing a PR echo "Checking if branch '$BRANCH' has elasticsearch sibling..." if [[ -z "$(git ls-remote --heads git@github.com:elastic/elasticsearch.git $BRANCH)" ]]; then echo "No sibling branch, using PR target branch"