infrastructure/secrets.enc.env (SOPS/age, dotenv) wird SOT; .env.production bleibt server-eigen/gitignored (war vorher GAR NICHT ignoriert — Loch geschlossen) und wird von deploy.sh (sops -d) erzeugt. Roundtrip verifiziert. Fleet-Standard: mana/docs/SECRETS_MANAGEMENT.md. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
36 lines
1.5 KiB
Bash
Executable file
36 lines
1.5 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
# Server-seitiges Deploy von Pageta (API + Web) auf dem Mac Mini.
|
|
#
|
|
# Voller Flow:
|
|
# lokal: git push
|
|
# Server: ssh mana-server-remote 'zsh -lc "cd ~/projects/pageta && git pull --ff-only && ./deploy.sh"'
|
|
#
|
|
# Entschlüsselt die Secrets (SOPS/age) nach infrastructure/.env.production und
|
|
# baut/recreatet pageta-api + pageta-web. infrastructure/secrets.enc.env ist die
|
|
# SOT (verschlüsselt, committed); .env.production ist gitignored.
|
|
# age-Privat-Key: ~/.config/sops/age/keys.txt. Doku: mana/docs/SECRETS_MANAGEMENT.md.
|
|
#
|
|
# Fallen (siehe Deploy-Memory): -p pageta Pflicht; KEIN --remove-orphans
|
|
# (pageta-landing ist separat); --no-deps lässt postgres in Ruhe.
|
|
set -euo pipefail
|
|
|
|
cd "$(dirname "$0")"
|
|
export PATH="/opt/homebrew/bin:/Applications/Docker.app/Contents/Resources/bin:$PATH"
|
|
export SOPS_AGE_KEY_FILE="$HOME/.config/sops/age/keys.txt"
|
|
|
|
if [ ! -f "$SOPS_AGE_KEY_FILE" ]; then
|
|
echo "FEHLER: age-Key $SOPS_AGE_KEY_FILE fehlt — siehe SECRETS_MANAGEMENT.md" >&2
|
|
exit 1
|
|
fi
|
|
|
|
echo "→ Secrets entschlüsseln (sops)…"
|
|
sops -d --input-type dotenv --output-type dotenv infrastructure/secrets.enc.env > infrastructure/.env.production.tmp
|
|
mv infrastructure/.env.production.tmp infrastructure/.env.production
|
|
chmod 600 infrastructure/.env.production
|
|
|
|
echo "→ pageta-api + pageta-web bauen + hochfahren…"
|
|
docker compose -p pageta -f infrastructure/docker-compose.production.yml \
|
|
--env-file infrastructure/.env.production \
|
|
up -d --build --no-deps pageta-api pageta-web
|
|
|
|
echo "✓ Deploy fertig."
|