summaryrefslogtreecommitdiff
path: root/tests/check.sh
diff options
context:
space:
mode:
authoryyamashita <yyamashita@hetzner.yyamashita.com>2026-10-31 22:45:58 +0900
committeryyamashita <yyamashita@hetzner.yyamashita.com>2026-10-31 22:45:58 +0900
commit05e1418efa56a773c295a2e072796e220d8d8f51 (patch)
tree5669d97650919db74e6f5f0174880e6e9221d770 /tests/check.sh
parentf48002a02c7b75de8add369672c861f63e900df4 (diff)
hetzner-admin: stop/start individual services, shown as STOPPED on status page
- run-command.sh: services / stop <name> / start <name> for app and infra stacks (not caddy, hetzner-admin, status). Stopped names go to status/stopped.txt (gitignored). - status: a stopped service that does not respond is STOPPED (gray), excluded from uptime and DOWN alerts. If it responds it is UP as usual. - Infra deploy.sh skips stopped stacks; app repo pushes clear the flag. - claude-code@.service: Restart=on-failure, and restart-sessions.sh restarts one unit at a time, to avoid the tmux "server exited unexpectedly" race. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N5eS3U54gzjRXzm65Np1RS
Diffstat (limited to 'tests/check.sh')
-rwxr-xr-xtests/check.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/check.sh b/tests/check.sh
index a19b55e..e0c9bed 100755
--- a/tests/check.sh
+++ b/tests/check.sh
@@ -85,6 +85,32 @@ EOF
)
echo ""
+echo "=== hetzner-admin: SERVICES が run-command.sh / status/targets.txt と一致するか ==="
+admin_services=$(python3 - <<'EOF'
+import ast
+tree = ast.parse(open("hetzner-admin/app.py").read())
+for node in ast.walk(tree):
+ if isinstance(node, ast.Assign) and getattr(node.targets[0], "id", "") == "SERVICES":
+ print(" ".join(e.value for e in node.value.elts))
+EOF
+)
+script_services=$(sed -n 's/^SERVICES="\(.*\)"$/\1/p' hetzner-admin/run-command.sh)
+if [[ "$admin_services" == "$script_services" ]]; then
+ ok "app.py と run-command.sh の SERVICES が一致"
+else
+ ng "SERVICES 不一致: app.py=[$admin_services] run-command.sh=[$script_services]"
+fi
+for name in $admin_services; do
+ if ! grep -qE "^ +$name\) " hetzner-admin/run-command.sh; then
+ ng "run-command.sh の service_compose に $name がない"
+ elif ! grep -qE "^$name\s" status/targets.txt; then
+ ng "status/targets.txt に $name がない(ステータスページと連動しない)"
+ else
+ ok "service: $name"
+ fi
+done
+
+echo ""
echo "=== 秘密ファイルがコミットされていないか ==="
for name in users.conf id_rsa id_rsa.pub .env; do
regex="(^|/)$(printf '%s' "$name" | sed 's/\./\\./g')\$"