Created
June 28, 2017 09:17
-
-
Save dbenchi/6430cac51f3a3e25a176dce99f45390a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MONGOPORT=23500 | |
BASEDIR=`pwd` | |
# Update tools | |
(cd repo && composer update) | |
# Run code style checker | |
./repo/vendor/bin/phpcs -p --standard=repo/vendor/sabre/dav/tests/phpcs/ruleset.xml --report-checkstyle=checkstyle.xml repo/lib/ | |
# Cleanup | |
rm -rf mongodb | |
rm -f mongo.pid | |
rm -f mongo.log | |
mkdir -p mongodb | |
# Start temporary mongo server | |
mongod --dbpath mongodb \ | |
--port $MONGOPORT \ | |
--pidfilepath $BASEDIR/mongo.pid \ | |
--logpath mongo.log \ | |
--fork | |
sleep 2 | |
# Configure | |
cat <<EOF > repo/config.json | |
{ | |
"webserver": { | |
"baseUri": "/", | |
"allowOrigin": "*" | |
}, | |
"database": { | |
"esn": { | |
"connectionString" : "mongodb://localhost:$MONGOPORT/", | |
"db": "esn", | |
"connectionOptions": { | |
"w": 1, | |
"fsync": true, | |
"connectTimeoutMS": 10000 | |
} | |
}, | |
"sabre": { | |
"connectionString" : "mongodb://localhost:$MONGOPORT/", | |
"db": "sabredav", | |
"connectionOptions": { | |
"w": 1, | |
"fsync": true, | |
"connectTimeoutMS": 10000 | |
} | |
} | |
}, | |
"esn": { | |
"apiRoot": "http://localhost:8080/api" | |
} | |
} | |
EOF | |
# Run unit tests | |
(cd repo/tests && ../vendor/bin/phpunit \ | |
--coverage-clover=$BASEDIR/clover.xml \ | |
--log-junit=$BASEDIR/junit.xml \ | |
.) | |
# Clean up | |
kill `cat mongo.pid` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment