#!/usr/bin/env bash # Deploy auf die NucBox. Nutzung: # with-secrets.sh invoice-check scripts/deploy.sh [--env-only] # 1) schreibt ~/invoice-check/.env aus Vault (ssh-stdin, nie auf der Kommandozeile) # 2) rsync Code 3) compose up --build 4) Health set -euo pipefail cd "$(dirname "$0")/.." HOST=c-stone-ai-lab@nucbox; DIR=/home/c-stone-ai-lab/invoice-check : "${POSTGRES_PASSWORD:?Vault}" "${SECRET_KEY:?Vault}" "${IMAP_USER:?Vault}" "${IMAP_PASSWORD:?Vault}" ssh "$HOST" "mkdir -p $DIR/rechnungen && umask 077 && cat > $DIR/.env" <&1 | tail -3" sleep 5; ssh "$HOST" "curl -sf localhost:8005/health" && echo " → Health OK"