websoft9/docker/w9apphub/config/entrypoint.sh

31 lines
700 B
Bash
Raw Normal View History

2023-09-18 17:13:15 +08:00
#!/bin/bash
2023-09-19 15:40:14 +08:00
# check
2023-09-19 18:53:05 +08:00
check_file_exists() {
file_path=$1
max_attempts=$2
2023-09-19 15:40:14 +08:00
2023-09-19 18:53:05 +08:00
for ((i=1; i<=max_attempts; i++))
do
if [ -f "$file_path" ]; then
echo "$file_path exists"
break
else
echo "$file_path is not exists, wait a moment.."
fi
sleep 2
if ((i==max_attempts)); then
echo "$file_path is not exists, timeout."
break
fi
done
}
2023-09-19 15:40:14 +08:00
2023-09-19 18:53:05 +08:00
check_file_exists "/websoft9/credentials/proxy" 10
check_file_exists "/websoft9/credentials/git" 10
check_file_exists "/websoft9/credentials/deployment" 10
2023-09-18 17:13:15 +08:00
2023-09-19 18:53:05 +08:00
# start by supervisord
2023-09-19 14:32:20 +08:00
/usr/local/bin/supervisord
2023-09-18 17:13:15 +08:00
supervisorctl start all
2023-09-19 14:32:20 +08:00
tail -f /dev/null