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@17f8ec1a9e
This commit is contained in:
parent
7483abb226
commit
373c350920
|
@ -69,7 +69,8 @@ if [ -z ${USE_EXISTING_ES:+x} ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
# AWAITSFIX: the fallback to master should be removed, see https://github.com/elastic/infra/issues/1557
|
# 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..."
|
echo "Checking if branch '$BRANCH' has elasticsearch sibling..."
|
||||||
if [[ -z "$(git ls-remote --heads git@github.com:elastic/elasticsearch.git $BRANCH)" ]]; then
|
if [[ -z "$(git ls-remote --heads git@github.com:elastic/elasticsearch.git $BRANCH)" ]]; then
|
||||||
echo "No sibling branch, using PR target branch"
|
echo "No sibling branch, using PR target branch"
|
||||||
|
|
Loading…
Reference in New Issue