Files
homelabstack/sync-prod.ps1
T
ginnoir bb46b1c10e feat: migrate stack to Portainer git-managed, rename project to valhalla-lab
- Rename project from htpc-download-box to valhalla-lab (directory + dc alias)
- Remove portainer and watchtower from compose; run standalone outside managed stack
  to prevent self-termination during Portainer-triggered redeployments
- Add portainer_proxy external network shared by caddy and standalone portainer
  so Caddy can route to Portainer via Docker DNS without them being in the same stack
- Carve out POST /api/stacks/webhooks/* in Caddyfile so Portainer webhooks can
  reach through the internal_only guard without exposing the full UI
- Update apply-compose.ps1 and sync-prod.ps1 paths from htpc-download-box to valhalla-lab
2026-06-03 23:09:53 -05:00

26 lines
973 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}:~/valhalla-lab/docker-compose.yml" "$repoDir\docker-compose.yml"
scp "${server}:~/valhalla-lab/.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