mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-15 16:57:09 +00:00
Fix travis script.
This commit is contained in:
@@ -11,7 +11,7 @@ install:
|
|||||||
- php artisan clear-compiled
|
- php artisan clear-compiled
|
||||||
- php artisan optimize
|
- php artisan optimize
|
||||||
- php artisan env
|
- php artisan env
|
||||||
- ./test.sh --notest --reset
|
- ./test.sh -r
|
||||||
- php artisan env
|
- php artisan env
|
||||||
|
|
||||||
script:
|
script:
|
||||||
|
26
test.sh
26
test.sh
@@ -6,6 +6,20 @@ ORIGINALENV=./.env
|
|||||||
BACKUPENV=./.env.current
|
BACKUPENV=./.env.current
|
||||||
TESTINGENV=./.env.testing
|
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):
|
# backup current config (if it exists):
|
||||||
if [ -f $ORIGINALENV ]; then
|
if [ -f $ORIGINALENV ]; then
|
||||||
mv $ORIGINALENV $BACKUPENV
|
mv $ORIGINALENV $BACKUPENV
|
||||||
@@ -17,7 +31,8 @@ cp $TESTINGENV $ORIGINALENV
|
|||||||
# clear cache:
|
# clear cache:
|
||||||
php artisan cache:clear
|
php artisan cache:clear
|
||||||
|
|
||||||
if [[ "$@" == "--reset" ]]
|
# reset database (optional)
|
||||||
|
if [[ $rflag == "true" ]]
|
||||||
then
|
then
|
||||||
echo "Must reset database"
|
echo "Must reset database"
|
||||||
|
|
||||||
@@ -35,14 +50,21 @@ then
|
|||||||
cp $DATABASE $DATABASECOPY
|
cp $DATABASE $DATABASECOPY
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# do not reset database (optional)
|
||||||
|
if [[ $rflag == "" ]]
|
||||||
|
then
|
||||||
|
echo "Will not reset database"
|
||||||
|
fi
|
||||||
|
|
||||||
# take database from copy:
|
# take database from copy:
|
||||||
cp $DATABASECOPY $DATABASE
|
cp $DATABASECOPY $DATABASE
|
||||||
|
|
||||||
# run PHPUnit
|
# run PHPUnit
|
||||||
if [[ "$@" == "--notest" ]]
|
if [[ $tflag == "" ]]
|
||||||
then
|
then
|
||||||
echo "Must not run PHPUnit"
|
echo "Must not run PHPUnit"
|
||||||
else
|
else
|
||||||
|
echo "Must run PHPUnit"
|
||||||
phpunit
|
phpunit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user