-
Notifications
You must be signed in to change notification settings - Fork 24
/
build.sh
executable file
·58 lines (47 loc) · 1.13 KB
/
build.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/sh
GRAY='\033[1;30m'
LIGHT_GRAY='\033[0;37m'
CYAN='\033[0;36m'
LIGHT_CYAN='\033[1;36m'
RED='\033[0;31m'
GREEN='\033[0;32m'
NC='\033[0m'
abort()
{
# Remove DB
#rm database/database.sqlite
echo >&2 "
${RED}********************
*** BUILD FAILED ***
********************
${NC}"
exit 1
}
trap 'abort' 0
set -e
# Run some general commands so we're up-to-date
composer self-update
composer install --no-interaction --optimize-autoloader
php artisan config:clear
# Setup DB
#touch database/database.sqlite
#php artisan migrate --database=database/database.sqlite --env=testing
# Start tests
echo >&2 "${CYAN}PHP Lint Test${NC}"
vendor/bin/parallel-lint --exclude vendor --exclude _ide_helper.php .
echo >&2 "${CYAN}PHPMD${NC}"
vendor/bin/phpmd app/ text phpmd.xml
echo >&2 "${CYAN}PHP Fixable PSR2 Issues${NC}"
vendor/bin/phpcbf --standard=psr2 app/
echo >&2 "${CYAN}PHP Coding Standards${NC}"
vendor/bin/phpcs --standard=psr2 --colors app/
echo >&2 "${CYAN}PHPUnit${NC}"
vendor/bin/phpunit
# Remove DB
#rm database/database.sqlite
trap : 0
echo >&2 "
${GREEN}********************
*** BUILD PASSED ***
********************
${NC}"