Skip to content

Commit

Permalink
Don't bother setting up postgres when testing against sqlite
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-north committed Feb 5, 2018
1 parent 61e6bb5 commit 4307695
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
6 changes: 1 addition & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@ install:
- npm install --no-shrinkwrap

before_script:
- rm -f dev.sqlite
- cp master.sqlite dev.sqlite
- npm run pg:setup
- npm run db:migrate --- up
- npm run db:migrate --- up -e pg
- ./scripts/ci/setup-db.sh

script:
- export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi)
Expand Down
19 changes: 19 additions & 0 deletions scripts/ci/setup-db.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash
if [ -n $DB_TYPE ]
then
if [[ $DB_TYPE == "postgres" ]]
then
echo "setting up postgres"
npm run pg:setup
npm run db:migrate --- up -e pg
exit
else
echo "setting up sqlite"
rm -f dev.sqlite
cp master.sqlite dev.sqlite
npm run db:migrate --- up
exit
fi
else
echo -e "DB_TYPE not set\n"
fi

0 comments on commit 4307695

Please sign in to comment.