Mirror the three production files (docker-compose.yml, .env, Caddyfile) that live on valhalla, plus the push/pull PowerShell scripts, CLAUDE.md, .gitignore/.gitattributes, and .claude/skills for ssh/apply/sync.
1.7 KiB
1.7 KiB
name, description
| name | description |
|---|---|
| homelab-apply | Push local config changes (docker-compose.yml, .env, Caddyfile) to the valhalla server and apply them to the live Docker stack. Use after editing homelab config to deploy it. This mutates the running production stack. |
homelab-apply
Deploys local repo changes to the live stack on valhalla. This mutates production — sync and review your diff first (see the homelab-sync skill).
Run it
powershell -File apply-compose.ps1 # push .env + Caddyfile + compose, then apply
powershell -File apply-compose.ps1 -EnvFile # .env only
powershell -File apply-compose.ps1 -Caddy # Caddyfile only + hot-reload Caddy
powershell -File apply-compose.ps1 -Compose # docker-compose.yml only + dc pull + dc up -d
Flags combine (e.g. -Caddy -Compose); no flags pushes & applies all three.
What each step does
.env/ compose →scpto~/htpc-download-box/, thendc pull(latest images) +dc up -d(recreates only containers whose resolved config changed).- Caddyfile →
scpto/config/caddy/Caddyfile, thendc exec caddy caddy reload …— a hot reload with no downtime. If the new Caddyfile is invalid the reload fails and the old config keeps running; read the output.
After applying, verify
ssh ginnoir@valhalla "bash -ic 'dc ps'"
ssh ginnoir@valhalla "bash -ic 'dc logs --tail=50 <service>'"
Notes
- Compose is v1.27.4 (
docker-compose, hyphenated);dcruns overbash -icto load the alias. - Editing config without applying does nothing — the server only sees pushed files.
- Cosmetic/whitespace-only compose edits are no-ops to running containers;
dc up -dwon't recreate them.