34 lines
1.3 KiB
Bash
34 lines
1.3 KiB
Bash
#!/usr/bin/env bats
|
|
# Seam: scripts/deploy.sh deploys the homepage, and the checker runs as a
|
|
# systemd timer. The deploy is git-driven (master = the deployed state, Q33).
|
|
# The tests assert the deploy references the homepage steps and renders the
|
|
# basicauth hash, and that the checker timer + service exist and point at the
|
|
# checker. (The homepage's per-user hashes were retired: it now uses Authentik
|
|
# forward_auth, so only the shared family hash is rendered.)
|
|
|
|
load helpers
|
|
|
|
@test "deploy.sh ships the homepage (assets, timer, basicauth hash, deployed.js)" {
|
|
local d="$REPO_ROOT/scripts/deploy.sh"
|
|
local r="$REPO_ROOT/scripts/deploy-remote.sh"
|
|
grep -q "deploy-remote.sh" "$d"
|
|
grep -q "/srv/homepage" "$r"
|
|
grep -q "homepage-status" "$r"
|
|
grep -q "CADDY_BASICAUTH_HASH" "$r"
|
|
grep -q "deployed.js" "$r"
|
|
}
|
|
|
|
@test "the checker runs as a systemd timer pointing at the checker" {
|
|
local s="$REPO_ROOT/scripts/homepage-status.service"
|
|
local t="$REPO_ROOT/scripts/homepage-status.timer"
|
|
[ -f "$s" ]
|
|
[ -f "$t" ]
|
|
grep -q "homepage-status.py" "$s"
|
|
grep -q "OnUnitActiveSec" "$t"
|
|
grep -q "homepage-status.service" "$t"
|
|
}
|
|
|
|
@test "deploy.sh is git-driven: it pulls main on the target" {
|
|
grep -q "git pull --ff-only origin main" "$REPO_ROOT/scripts/deploy.sh"
|
|
}
|