-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·56 lines (48 loc) · 922 Bytes
/
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
#!/bin/sh
DOCKER_EXEC="docker exec -it task-php"
DOCKER_COMPOSE="docker-compose"
PHPUNIT_CMD="php -d memory_limit=-1 vendor/bin/phpunit --color=always"
start() {
${DOCKER_COMPOSE} up -d
}
down() {
${DOCKER_COMPOSE} down
}
configure() {
${DOCKER_EXEC} composer install
${DOCKER_EXEC} bin/console db:create:db
${DOCKER_EXEC} bin/console db:create:schema
${DOCKER_EXEC} bin/console message:create:exchange
}
testAll() {
${DOCKER_EXEC} ${PHPUNIT_CMD}
}
testAllWithMetrics() {
${DOCKER_EXEC} ${PHPUNIT_CMD} --coverage-html metrics
}
quality() {
${DOCKER_EXEC} composer phpcbf
${DOCKER_EXEC} composer phpstan
}
case "$1" in
test)
testAll
;;
metrics)
testAllWithMetrics
;;
quality)
quality
;;
start)
start
;;
down)
down
;;
configure)
configure
;;
*)
echo "Usage: $0 {start|down|configure|test|metrics|quality}"
esac