forked from AOEpeople/MageTestStand
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
41 lines (30 loc) · 1.15 KB
/
setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
set -e
set -x
# check if this is a travis environment
function cleanup {
echo "Removing build directory ${BUILDENV}"
rm -rf ${BUILDENV}
}
trap cleanup EXIT
echo "zend_extenstion = xdebug.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
if [ ! -z $TRAVIS_BUILD_DIR ] ; then
WORKSPACE=$TRAVIS_BUILD_DIR
fi
if [ -z $WORKSPACE ] ; then
echo "No workspace configured, please set your WORKSPACE environment"
exit
fi
BUILDENV=`mktemp -d /tmp/mageteststand.XXXXXXXX`
echo "Using build directory ${BUILDENV}"
git clone https://github.com/webguys-de/MageTestStand.git ${BUILDENV}
cp -rf ${WORKSPACE} ${BUILDENV}/.modman/
${BUILDENV}/install.sh
cd ${BUILDENV}/htdocs
cp ${WORKSPACE}/phpunit.xml.dist .
${BUILDENV}/bin/phpunit --coverage-clover ${BUILDENV}/build/logs/clover.xml --colors -d display_errors=1
echo "Exporting test results to code climate"
cd ${BUILDENV}
vendor/codeclimate/php-test-reporter/composer/bin/test-reporter --stdout > codeclimate.json
curl -X POST -d @codeclimate.json -H 'Content-Type: application/json' -H 'User-Agent: Code Climate (PHP Test Reporter v1.0.1-dev)' https://codeclimate.com/test_reports
echo "Done."