This commit is contained in:
qiaofeng1227 2023-09-21 17:26:14 +08:00
parent 231d36c5ce
commit b096dc9fa6
3 changed files with 4 additions and 21 deletions

View File

@ -29,7 +29,6 @@ RUN apt update && apt install git jq supervisor -y && \
RUN pip install --upgrade pip && pip install -r apphub/requirements.txt
# supervisor
# RUN pip install supervisor
COPY config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
RUN chmod +r /etc/supervisor/conf.d/supervisord.conf
COPY config/entrypoint.sh /entrypoint.sh

View File

@ -13,7 +13,7 @@ check_file_exists() {
else
echo "$file_path is not exists, wait a moment.."
fi
sleep 2
sleep 1
if ((i==max_attempts)); then
echo "$file_path is not exists, app may be work normally."
break
@ -21,25 +21,9 @@ check_file_exists() {
done
}
check_file_exists "/websoft9/credentials/proxy" 10
check_file_exists "/websoft9/credentials/deployment" 10
check_file_exists "/websoft9/credentials/git" 10
if [ -f "/websoft9/credentials/git" ]; then
# init git
content=$(cat /websoft9/credentials/git)
username=$(echo "$content" | jq -r '.username')
password=$(echo "$content" | jq -r '.password')
email=$(echo "$content" | jq -r '.email')
echo "start to init git"
git config --global user.name $username
git config --global user.email $email
git config --global user.password $password
else
# git user not exist, output the error message
echo "can not init git"
fi
check_file_exists "/websoft9/credentials/proxy" 1
check_file_exists "/websoft9/credentials/deployment" 1
check_file_exists "/websoft9/credentials/git" 1
# start by supervisord
/usr/bin/supervisord