fix: 增加微信登录配置部署检查
This commit is contained in:
1 parent
e75c524343
commit
92227e1311
5 files changed
+24
-2
No files matched your search
@@ -43,6 +43,7 @@ export function buildRemoteStatusScript({ deployRoot: rootPath = deployRoot } =
|
||||
'printf "backup-timer="; systemctl --user is-active personal-brand-backup.timer',
|
||||
'printf "backup-age-hours="; newest=$(find "$DEPLOY_ROOT/shared/backups" -maxdepth 1 -type f -name "*.dump" -printf "%T@ %p\\n" | sort -nr | head -1 | cut -d" " -f2-); age=$(( ( $(date +%s) - $(stat -c %Y "$newest") ) / 3600 )); echo "$age"; test "$age" -le "${BACKUP_MAX_AGE_HOURS:-36}"',
|
||||
'printf "backup-temp-files="; find "$DEPLOY_ROOT/shared/backups" -maxdepth 1 -type f -name "*.tmp" | wc -l',
|
||||
'printf "wechat-login="; if grep -q "^WECHAT_APP_ID=." "$DEPLOY_ROOT/shared/.env.production" && grep -q "^WECHAT_APP_SECRET=." "$DEPLOY_ROOT/shared/.env.production"; then echo configured; else echo missing; exit 1; fi',
|
||||
'printf "disk="; df -h / | awk \'NR==2 {print $5 " used, " $4 " free"}\'',
|
||||
'printf "release-count="; find "$DEPLOY_ROOT/releases" -mindepth 1 -maxdepth 1 -type d | wc -l',
|
||||
].join("; ");
|
||||
|
||||
@@ -12,6 +12,8 @@ test("生产状态脚本不再要求 VPS 上运行 CI runner", () => {
|
||||
assert.match(script, /personal-brand-backup\.timer/);
|
||||
assert.match(script, /backup-age-hours/);
|
||||
assert.match(script, /BACKUP_MAX_AGE_HOURS/);
|
||||
assert.match(script, /wechat-login/);
|
||||
assert.match(script, /WECHAT_APP_SECRET/);
|
||||
});
|
||||
|
||||
test("生产状态脚本语法有效", () => {
|
||||
|
||||
Reference in new issue
Block a user