Files
homelabstack/sync-prod.ps1
T
ginnoir 56d834ede9 chore: initial homelab stack config and sync tooling
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.
2026-06-02 22:12:07 -05:00

26 lines
983 B
PowerShell

# Pull the live production configs from valhalla into this repo, so local
# matches what's actually deployed. Run at the start of any session where
# you'll edit deployment config.
#
# Production is the source of truth. This OVERWRITES the local copies of
# docker-compose.yml, .env, and Caddyfile -- commit or stash first.
#
# Usage: powershell -File sync-prod.ps1
$ErrorActionPreference = "Stop"
$PSNativeCommandUseErrorActionPreference = $true
$server = "ginnoir@valhalla"
$repoDir = $PSScriptRoot
Write-Host "Syncing production configs from $server ..."
scp "${server}:~/htpc-download-box/docker-compose.yml" "$repoDir\docker-compose.yml"
scp "${server}:~/htpc-download-box/.env" "$repoDir\.env"
scp "${server}:/config/caddy/Caddyfile" "$repoDir\Caddyfile"
Write-Host "Done. Files synced:"
Get-ChildItem $repoDir -File |
Where-Object { $_.Name -in 'docker-compose.yml', '.env', 'Caddyfile' } |
Select-Object Name, Length, LastWriteTime