Skip to content

Commit

Permalink
Merge pull request #498 from senecajs/travis
Browse files Browse the repository at this point in the history
detect PR branch
  • Loading branch information
mihaidma authored Aug 22, 2016
2 parents da6f48a + 3ba6923 commit 10efa0e
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ node_js:
- '6'

env:
global:
# get the latest seneca code from master,
# to test a specific tagged version set the version like below.
- SENECA_VER=
# - SENECA_VER=#v1.3.0

matrix:
- TEST_SUITE=senecajs/seneca
- TEST_SUITE=senecajs/gate-executor
Expand All @@ -20,15 +14,21 @@ env:
- TEST_SUITE=senecajs/seneca-transport

before_script:
- export PR=https://api.github.com/repos/$TRAVIS_REPO_SLUG/pulls/$TRAVIS_PULL_REQUEST
- export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo `curl -s $PR | jq -r .head.ref`; fi)
- if [ "null" == "$BRANCH" ]; then BRANCH=""; else BRANCH="#$BRANCH"; fi
- echo "TRAVIS_BRANCH=$TRAVIS_BRANCH, PR=$PR, BRANCH=$BRANCH"
- TEST_SUITE_FOLDER=$(basename $TEST_SUITE)
- echo TEST_SUITE:$TEST_SUITE
- echo TEST_SUITE_FOLDER:$TEST_SUITE_FOLDER
- echo "TEST_SUITE:$TEST_SUITE"
- echo "TEST_SUITE_FOLDER:$TEST_SUITE_FOLDER"
- SENECA_INSTALL=https://github.com/senecajs/seneca$BRANCH;
- echo "SENECA_INSTALL:$SENECA_INSTALL";
- if [ $TEST_SUITE_FOLDER != 'seneca' ]; then
git clone https://github.com/$TEST_SUITE;
cd $TEST_SUITE_FOLDER;
npm i;
npm uninstall seneca;
npm install https://github.com/senecajs/seneca$SENECA_VER;
npm install $SENECA_INSTALL;
fi

cache:
Expand Down

0 comments on commit 10efa0e

Please sign in to comment.