fix(deploy): bash 3.2 compat, sshpass auth, sync admin dist to public/admin

- Replace bash 4.2+ printf %(...)T with date subshell so script runs on
  the macOS-default bash 3.2.
- Add SSH_PASS_FILE / SSH_PASSWORD support via sshpass for environments
  where password auth is the only path.
- After admin npm build, rsync view/admin/dist/ into public/admin/
  (preserving UEditor and favicon) so the project rsync ships the
  admin to the path nginx actually serves from.
- Simplify rsync exclude list to drop view/admin/ wholesale.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
danaisuiyuan
2026-05-10 15:47:24 +08:00
parent b1882f1f11
commit 9559031536
3 changed files with 40 additions and 14 deletions

View File

@@ -7,6 +7,12 @@ SSH_PORT=22
REMOTE_ROOT=/www/wwwroot/syj.fsgx.cn
REMOTE_BAK=/www/wwwroot/syj.fsgx.cn-bak
# 密码认证(可选):把 SSH 密码放在仓库外的 600 文件里,例如 ~/.ssh/syj-deploy.pass
# 优先级SSH_PASS_FILE > $SSH_PASSWORD env > 公钥认证
# 文件方式(推荐):
# echo 'YOUR_PASSWORD' > ~/.ssh/syj-deploy.pass && chmod 600 ~/.ssh/syj-deploy.pass
SSH_PASS_FILE=~/.ssh/syj-deploy.pass
# 健康检查 URL任一非 200 即触发回滚
HEALTH_URLS=(
"https://syj.fsgx.cn/api/version"