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: 远程执行部署
|
||||
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
|
||||
cd $DEPLOY_PATH
|
||||
cd ${{ env.DEPLOY_PATH }}
|
||||
git fetch origin main
|
||||
|
||||
# 备份运行时db
|
||||
@@ -30,8 +30,8 @@ jobs:
|
||||
|
||||
git checkout origin/main -- .
|
||||
|
||||
CHANGED=$(git diff --name-only HEAD FETCH_HEAD | grep "data/miniapp_v3.db" || true)
|
||||
if [ -z "$CHANGED" ]; then
|
||||
CHANGED=\$(git diff --name-only HEAD FETCH_HEAD | grep "data/miniapp_v3.db" || true)
|
||||
if [ -z "\$CHANGED" ]; then
|
||||
if [ -f data/miniapp_v3.db.tmp ]; then
|
||||
cp data/miniapp_v3.db.tmp data/miniapp_v3.db
|
||||
fi
|
||||
@@ -42,10 +42,10 @@ jobs:
|
||||
chown -R www:www .
|
||||
|
||||
# 获取gunicorn master进程,发送HUP优雅重载
|
||||
MASTER_PID=$(pgrep -f "gunicorn_conf.py" -P 1)
|
||||
echo "Detected gunicorn master PID: $MASTER_PID"
|
||||
if [ -n "$MASTER_PID" ]; then
|
||||
kill -HUP "$MASTER_PID"
|
||||
MASTER_PID=\$(pgrep -f "gunicorn_conf.py" -P 1)
|
||||
echo "Detected gunicorn master PID: \$MASTER_PID"
|
||||
if [ -n "\$MASTER_PID" ]; then
|
||||
kill -HUP "\$MASTER_PID"
|
||||
echo "✅ Graceful reload signal sent"
|
||||
else
|
||||
echo "⚠️ Gunicorn master not found, skip reload"
|
||||
|
||||
Reference in New Issue
Block a user