qiaofeng1227 1 年之前
父节点
当前提交
2eeae98e97
共有 2 个文件被更改,包括 21 次插入7 次删除
  1. 1 1
      docker/apphub/Dockerfile
  2. 20 6
      docker/apphub/config/entrypoint.sh

+ 1 - 1
docker/apphub/Dockerfile

@@ -15,7 +15,7 @@ RUN wget https://github.com/Websoft9/docker-library/archive/refs/tags/$LIBRARY_V
     mv -f plugin-appstore/data ./media && \
     git clone --depth=1 https://github.com/Websoft9/websoft9
 
-FROM python:3.10-slim
+FROM python:3.10-slim-bullseye
 WORKDIR  /websoft9
 
 COPY --from=buildstage /media/data ./media

+ 20 - 6
docker/apphub/config/entrypoint.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
 
-# check 
+# check credentials exists
 check_file_exists() {
     file_path=$1
     max_attempts=$2
@@ -9,21 +9,35 @@ check_file_exists() {
     do
         if [ -f "$file_path" ]; then
             echo "$file_path exists"
-            break
+            return 0
         else
             echo "$file_path is not exists, wait a moment.."
         fi
         sleep 1
         if ((i==max_attempts)); then
             echo "$file_path is not exists, app may be work normally."
-            break
+            return 1
         fi
     done
 }
 
-check_file_exists "/websoft9/credentials/proxy" 1
-check_file_exists "/websoft9/credentials/deployment" 1
-check_file_exists "/websoft9/credentials/git" 1
+set +e 
+check_file_exists "/websoft9/credentials/credential_proxy" 1
+check_file_exists "/websoft9/credentials/credential_deployment" 1
+check_file_exists "/websoft9/credentials/credential_git" 1
+
+# set git user and email
+if [ $? -eq 0 ]; then
+    username=$(jq -r '.username' /websoft9/credentials/credential_git)
+    password=$(jq -r '.email' /websoft9/credentials/credential_git)
+else
+    echo "Git set with default value"
+    username="websoft9"
+    password="help@websoft9.com"
+fi
+git config --global user.name "$username"
+git config --global user.email "$password"
+set -e
 
 # start by supervisord
 /usr/bin/supervisord