-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathloop-validate.sh
More file actions
executable file
·40 lines (30 loc) · 931 Bytes
/
loop-validate.sh
File metadata and controls
executable file
·40 lines (30 loc) · 931 Bytes
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
#!/bin/bash
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
RUNNING=1
_term(){
echo "$BASH_SOURCE - caught signal, terminating..."
RUNNING=0
kill -s SIGTERM $child_pid
wait
}
# Note that trapping SIGWINCH is due to weird usage of this "window resized" by apache2
# (see https://bz.apache.org/bugzilla/show_bug.cgi?id=50669)
# ...propagated to STOPSIGNAL=SIGWINCH in php:8.2-apache docker image
# ...which leads to an unexpected behavior of "docker stop"
# ...and probably problems with PHP applications including console commands (Symfony, Laravel,...)
trap _term SIGTERM SIGINT SIGWINCH
echo "$BASH_SOURCE - started with PID=$$"
while [ $RUNNING -eq 1 ]
do
php "${SCRIPT_DIR}/bin/console" ign-validator:validations:process-one -vvv &
child_pid=$!
wait $child_pid
if [ $RUNNING -eq 0 ];
then
break;
fi
sleep 15 &
child_pid=$!
wait $child_pid
done
echo "$BASH_SOURCE - stopped"