diff --git a/docker/apphub/Dockerfile b/docker/apphub/Dockerfile index e35e2551..4f53e47f 100644 --- a/docker/apphub/Dockerfile +++ b/docker/apphub/Dockerfile @@ -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 diff --git a/docker/apphub/credential.json b/docker/apphub/config/credential_template.json similarity index 100% rename from docker/apphub/credential.json rename to docker/apphub/config/credential_template.json diff --git a/docker/apphub/config/entrypoint.sh b/docker/apphub/config/entrypoint.sh index c32657e3..f8a29559 100644 --- a/docker/apphub/config/entrypoint.sh +++ b/docker/apphub/config/entrypoint.sh @@ -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