-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathentrypoint.sh
More file actions
executable file
·56 lines (49 loc) · 1.49 KB
/
Copy pathentrypoint.sh
File metadata and controls
executable file
·56 lines (49 loc) · 1.49 KB
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/bash
set -e
gosu web mkdir -p /var/app/var/{cache,log}
if [[ "$3" == *"php-fpm7.4"* ]] && [ -z "$DONT_RUN_COMPOSER" ]; then
gosu web composer install -n
gosu web bin/console cache:clear
gosu web bin/console cache:warmup
fi
echo "Exporting php env configuration..."
PHP_CONF_ENV=/etc/php/7.4/fpm/pool.d/www.conf.env
PHP_CONF=/etc/php/7.4/fpm/pool.d/www.conf
AVAILABLE_VARIABLES=$(env | sed -E "s/([^=]+)=.*?/$\1/" | tr "\n" " ")
envsubst "$AVAILABLE_VARIABLES"<"$PHP_CONF_ENV" > $PHP_CONF
echo "Done."
if [[ "$1" == "console" ]]; then
ARGUMENTS=( web bin/console )
ARGUMENTS+=( ${@:2} )
exec "gosu" ${ARGUMENTS[@]}
exit
elif [[ "$1" == "composer" ]]; then
ARGUMENTS=( web composer )
ARGUMENTS+=( ${@:2} )
exec "gosu" ${ARGUMENTS[@]}
exit
elif [[ "$1" == "behat" ]]; then
if [[ "$2" == "watch" ]]; then
unset IFS
ARGUMENTS+=( ${@:3} )
inotifywait -rme create,delete,modify,move --exclude '.*\.(swp|swx|.*~)$' ./src ./tests ./features ./config | while read LINE; do
# debounce clodo
JOBS=`jobs -r -p | xargs`
if [ ! -z $JOBS ]; then
kill -9 $JOBS
fi
(
sleep 1
# echo "Reload fixtures..."
# gosu web ./bin/console doctrine:fixtures:load --purge-with-truncate -q
echo "Behat time"
gosu web ./vendor/bin/behat ${ARGUMENTS[@]} --strict < /dev/null
)&
done
else
ARGUMENTS+=( ${@:2} )
gosu web ./vendor/bin/behat ${ARGUMENTS[@]} --strict < /dev/null
fi
exit
fi
exec "$@"