Archived
Merge pull request 'v9' (#9) from jacky-patch-5 into main
Reviewed-on: http://117.72.28.96:8765/Jacky/Hulumath-Web-Demo/pulls/9
This commit was merged in pull request #9.
This commit is contained in:
@@ -18,9 +18,9 @@ jobs:
|
|||||||
|
|
||||||
- name: 远程执行部署
|
- name: 远程执行部署
|
||||||
run: |
|
run: |
|
||||||
ssh -i ~/.ssh/deploy_key ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }} <<-'EOF'
|
ssh -i ~/.ssh/deploy_key ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }} <<EOF
|
||||||
set -e
|
set -e
|
||||||
cd $DEPLOY_PATH
|
cd ${{ env.DEPLOY_PATH }}
|
||||||
git fetch origin main
|
git fetch origin main
|
||||||
|
|
||||||
# 备份运行时db
|
# 备份运行时db
|
||||||
@@ -30,8 +30,8 @@ jobs:
|
|||||||
|
|
||||||
git checkout origin/main -- .
|
git checkout origin/main -- .
|
||||||
|
|
||||||
CHANGED=$(git diff --name-only HEAD FETCH_HEAD | grep "data/miniapp_v3.db" || true)
|
CHANGED=\$(git diff --name-only HEAD FETCH_HEAD | grep "data/miniapp_v3.db" || true)
|
||||||
if [ -z "$CHANGED" ]; then
|
if [ -z "\$CHANGED" ]; then
|
||||||
if [ -f data/miniapp_v3.db.tmp ]; then
|
if [ -f data/miniapp_v3.db.tmp ]; then
|
||||||
cp data/miniapp_v3.db.tmp data/miniapp_v3.db
|
cp data/miniapp_v3.db.tmp data/miniapp_v3.db
|
||||||
fi
|
fi
|
||||||
@@ -42,12 +42,12 @@ jobs:
|
|||||||
chown -R www:www .
|
chown -R www:www .
|
||||||
|
|
||||||
# 获取gunicorn master进程,发送HUP优雅重载
|
# 获取gunicorn master进程,发送HUP优雅重载
|
||||||
MASTER_PID=$(pgrep -f "gunicorn_conf.py" -P 1)
|
MASTER_PID=\$(pgrep -f "gunicorn_conf.py" -P 1)
|
||||||
echo "Detected gunicorn master PID: $MASTER_PID"
|
echo "Detected gunicorn master PID: \$MASTER_PID"
|
||||||
if [ -n "$MASTER_PID" ]; then
|
if [ -n "\$MASTER_PID" ]; then
|
||||||
kill -HUP "$MASTER_PID"
|
kill -HUP "\$MASTER_PID"
|
||||||
echo "✅ Graceful reload signal sent"
|
echo "✅ Graceful reload signal sent"
|
||||||
else
|
else
|
||||||
echo "⚠️ Gunicorn master not found, skip reload"
|
echo "⚠️ Gunicorn master not found, skip reload"
|
||||||
fi
|
fi
|
||||||
EOF
|
EOF
|
||||||
Reference in New Issue
Block a user