mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-01-26 16:26:35 -06:00
Fix travis script.
This commit is contained in:
parent
01e3f91ece
commit
5a2ef36f2a
@ -11,7 +11,7 @@ install:
|
||||
- php artisan clear-compiled
|
||||
- php artisan optimize
|
||||
- php artisan env
|
||||
- ./test.sh --notest --reset
|
||||
- ./test.sh -r
|
||||
- php artisan env
|
||||
|
||||
script:
|
||||
|
26
test.sh
26
test.sh
@ -6,6 +6,20 @@ ORIGINALENV=./.env
|
||||
BACKUPENV=./.env.current
|
||||
TESTINGENV=./.env.testing
|
||||
|
||||
# do something with flags:
|
||||
rflag=''
|
||||
tflag=''
|
||||
|
||||
while getopts 'rt' flag; do
|
||||
case "${flag}" in
|
||||
r) rflag='true' ;;
|
||||
t) tflag='true' ;;
|
||||
*) error "Unexpected option ${flag}" ;;
|
||||
esac
|
||||
done
|
||||
|
||||
|
||||
|
||||
# backup current config (if it exists):
|
||||
if [ -f $ORIGINALENV ]; then
|
||||
mv $ORIGINALENV $BACKUPENV
|
||||
@ -17,7 +31,8 @@ cp $TESTINGENV $ORIGINALENV
|
||||
# clear cache:
|
||||
php artisan cache:clear
|
||||
|
||||
if [[ "$@" == "--reset" ]]
|
||||
# reset database (optional)
|
||||
if [[ $rflag == "true" ]]
|
||||
then
|
||||
echo "Must reset database"
|
||||
|
||||
@ -35,14 +50,21 @@ then
|
||||
cp $DATABASE $DATABASECOPY
|
||||
fi
|
||||
|
||||
# do not reset database (optional)
|
||||
if [[ $rflag == "" ]]
|
||||
then
|
||||
echo "Will not reset database"
|
||||
fi
|
||||
|
||||
# take database from copy:
|
||||
cp $DATABASECOPY $DATABASE
|
||||
|
||||
# run PHPUnit
|
||||
if [[ "$@" == "--notest" ]]
|
||||
if [[ $tflag == "" ]]
|
||||
then
|
||||
echo "Must not run PHPUnit"
|
||||
else
|
||||
echo "Must run PHPUnit"
|
||||
phpunit
|
||||
fi
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user