From 2c462bdfb4fac7ea4d48fea568e0fa4b4d04341d Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 22 May 2017 16:27:41 +0100 Subject: [PATCH 1/4] Add right-branch logic to travis test script --- .travis-test-riot.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis-test-riot.sh b/.travis-test-riot.sh index c280044246..bab8242146 100755 --- a/.travis-test-riot.sh +++ b/.travis-test-riot.sh @@ -9,7 +9,10 @@ set -ev RIOT_WEB_DIR=riot-web REACT_SDK_DIR=`pwd` -git clone --depth=1 --branch develop https://github.com/vector-im/riot-web.git \ +curbranch="${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}" +echo "Determined branch to be $curbranch" + +git clone --depth=1 --branch "$curbranch" https://github.com/vector-im/riot-web.git \ "$RIOT_WEB_DIR" cd "$RIOT_WEB_DIR" From 77cd9d78db07a0030f00ff87b1bcc2536217df2a Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 22 May 2017 16:34:15 +0100 Subject: [PATCH 2/4] Use develop if no matching branch found --- .travis-test-riot.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis-test-riot.sh b/.travis-test-riot.sh index bab8242146..ee0f45e1ec 100755 --- a/.travis-test-riot.sh +++ b/.travis-test-riot.sh @@ -12,9 +12,11 @@ REACT_SDK_DIR=`pwd` curbranch="${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}" echo "Determined branch to be $curbranch" -git clone --depth=1 --branch "$curbranch" https://github.com/vector-im/riot-web.git \ +git clone --depth=1 https://github.com/vector-im/riot-web.git \ "$RIOT_WEB_DIR" +git checkout "$curbranch" || git checkout develop + cd "$RIOT_WEB_DIR" mkdir node_modules From c5a873c316c0d6e5857db5513cd3ccb43d909bc9 Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 22 May 2017 16:41:43 +0100 Subject: [PATCH 3/4] Remove depth=1 otherwise we won't find the branch --- .travis-test-riot.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis-test-riot.sh b/.travis-test-riot.sh index ee0f45e1ec..c0cd911f08 100755 --- a/.travis-test-riot.sh +++ b/.travis-test-riot.sh @@ -12,7 +12,7 @@ REACT_SDK_DIR=`pwd` curbranch="${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}" echo "Determined branch to be $curbranch" -git clone --depth=1 https://github.com/vector-im/riot-web.git \ +git clone https://github.com/vector-im/riot-web.git \ "$RIOT_WEB_DIR" git checkout "$curbranch" || git checkout develop From 52d3dd4de90259cb1374e02b3c7dd7a0829ac390 Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 22 May 2017 16:48:53 +0100 Subject: [PATCH 4/4] cd first so we checkout the right repo --- .travis-test-riot.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis-test-riot.sh b/.travis-test-riot.sh index c0cd911f08..4296c72e6c 100755 --- a/.travis-test-riot.sh +++ b/.travis-test-riot.sh @@ -15,10 +15,10 @@ echo "Determined branch to be $curbranch" git clone https://github.com/vector-im/riot-web.git \ "$RIOT_WEB_DIR" -git checkout "$curbranch" || git checkout develop - cd "$RIOT_WEB_DIR" +git checkout "$curbranch" || git checkout develop + mkdir node_modules npm install