Update docker-entrypoint.sh
Browse files- docker-entrypoint.sh +6 -7
docker-entrypoint.sh
CHANGED
|
@@ -15,12 +15,12 @@ GITHUB_TOKEN=$GITHUB_TOKEN
|
|
| 15 |
REPO_URL="https://${GITHUB_TOKEN}@github.com/lang03383/hf_ql_his.git"
|
| 16 |
|
| 17 |
# 检查是否已初始化Git仓库
|
| 18 |
-
if [ ! -d "/
|
| 19 |
# 如果没有初始化Git仓库,则克隆仓库
|
| 20 |
-
git clone $REPO_URL /
|
| 21 |
else
|
| 22 |
# 如果已经初始化了Git仓库,则拉取最新内容
|
| 23 |
-
cd /
|
| 24 |
git pull origin main
|
| 25 |
fi
|
| 26 |
|
|
@@ -66,11 +66,10 @@ echo -e "====================7. 启动实时同步到GitHub=====================
|
|
| 66 |
# 设置远程仓库地址
|
| 67 |
git remote set-url origin $REPO_URL
|
| 68 |
|
| 69 |
-
#
|
| 70 |
-
inotifywait -m -r -e modify,attrib,close_write,move,create,delete /
|
| 71 |
while read -r directory events filename; do
|
| 72 |
-
|
| 73 |
-
cd /path/to/your/qinglong/project
|
| 74 |
git add .
|
| 75 |
git commit -m "Automated commit for $filename on $(date)"
|
| 76 |
git push origin main
|
|
|
|
| 15 |
REPO_URL="https://${GITHUB_TOKEN}@github.com/lang03383/hf_ql_his.git"
|
| 16 |
|
| 17 |
# 检查是否已初始化Git仓库
|
| 18 |
+
if [ ! -d "/ql/data/.git" ]; then
|
| 19 |
# 如果没有初始化Git仓库,则克隆仓库
|
| 20 |
+
git clone $REPO_URL /ql/data
|
| 21 |
else
|
| 22 |
# 如果已经初始化了Git仓库,则拉取最新内容
|
| 23 |
+
cd /ql/data
|
| 24 |
git pull origin main
|
| 25 |
fi
|
| 26 |
|
|
|
|
| 66 |
# 设置远程仓库地址
|
| 67 |
git remote set-url origin $REPO_URL
|
| 68 |
|
| 69 |
+
# 启动实时同步部分
|
| 70 |
+
inotifywait -m -r -e modify,attrib,close_write,move,create,delete /ql/data |
|
| 71 |
while read -r directory events filename; do
|
| 72 |
+
cd /ql/data
|
|
|
|
| 73 |
git add .
|
| 74 |
git commit -m "Automated commit for $filename on $(date)"
|
| 75 |
git push origin main
|