-
Notifications
You must be signed in to change notification settings - Fork 11
/
entrypoint.sh
executable file
·33 lines (28 loc) · 994 Bytes
/
entrypoint.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
#!/bin/bash
export DB_DATABASE=wordpress
export DB_USERNAME=wp_mail_catcher
export DB_PASSWORD=password
export PHP_VERSION=8.0
export WP_VERSION=6.6.1
CMD=$1
run_grunt() {
docker-compose run --name grunt --rm "$@"
}
run_composer() {
docker-compose run --name composer --rm composer "$@"
}
if [ "$CMD" == "up" ]; then
run_grunt grunt compile
run_composer composer install
docker-compose "$@"
elif [ "$CMD" == "phpunit" ]; then
docker-compose run --name phpunit --rm -w /var/www/html/wp-content/plugins/wp-mail-catcher wordpress ./vendor/bin/phpunit
elif [ "$CMD" == "grunt" ]; then
run_grunt "$@"
elif [ "$CMD" == "composer" ]; then
run_composer "$@"
elif [ "$CMD" == "phpstan" ]; then
docker-compose run --name phpstan --rm -w /var/www/html/wp-content/plugins/wp-mail-catcher wordpress ./vendor/bin/phpstan analyze
elif [ "$CMD" == "phpcs" ]; then
docker-compose run --name phpcs --rm -w /var/www/html/wp-content/plugins/wp-mail-catcher wordpress ./vendor/bin/phpcs
fi