From 0040ea0d9f76b27eef56b64db02d6cccc262e532 Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 2 May 2018 15:53:38 +0100 Subject: [PATCH] Use develop js-sdk in travis build --- jenkins.sh | 5 +++-- scripts/fetchdep.sh | 14 +++++++++++--- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/jenkins.sh b/jenkins.sh index 3a2d66739e..0f7a58ee69 100755 --- a/jenkins.sh +++ b/jenkins.sh @@ -11,8 +11,9 @@ set -x # install the other dependencies npm install -# we may be using a dev branch of js-sdk in which case we need to build it -(cd node_modules/matrix-js-sdk && npm install) +scripts/fetchdep.sh matrix-org matrix-js-sdk +ln -s ../matrix-js-sdk node_modules/matrix-js-sdk +(cd matrix-js-sdk && npm install) # run the mocha tests npm run test -- --no-colors diff --git a/scripts/fetchdep.sh b/scripts/fetchdep.sh index 424a8b034c..14111576bf 100755 --- a/scripts/fetchdep.sh +++ b/scripts/fetchdep.sh @@ -5,8 +5,16 @@ set -e org="$1" repo="$2" -curbranch="${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}" -echo "Determined branch to be $curbranch" +curbranch="$TRAVIS_PULL_REQUEST_BRANCH" +[ -z "$curbranch" ] && curbranch="$TRAVIS_BRANCH" +[ -z "$curbranch" ] && curbranch="$GIT_BRANCH" # jenkins -git clone https://github.com/$org/$repo.git $repo --branch "$curbranch" || git clone https://github.com/$org/$repo.git $repo --branch develop +if [ -n "$curbranch" ] +then + echo "Determined branch to be $curbranch" + git clone https://github.com/$org/$repo.git $repo --branch "$curbranch" && exit 0 +fi + +echo "Checking out develop branch" +git clone https://github.com/$org/$repo.git $repo --branch develop