Files
pdf_to_ics/deploy.sh

42 lines
987 B
Bash
Executable File
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"
COMPOSE_FILE="docker-compose.deploy.yml"
if ! command -v docker >/dev/null 2>&1; then
echo "❌ Fehler: docker ist nicht installiert oder nicht im PATH."
exit 1
fi
if ! docker compose version >/dev/null 2>&1; then
echo "❌ Fehler: docker compose ist nicht verfügbar."
exit 1
fi
if [ ! -f "$COMPOSE_FILE" ]; then
echo "❌ Fehler: $COMPOSE_FILE nicht gefunden."
exit 1
fi
if [ ! -f ".env" ]; then
if [ -f ".env.example" ]; then
cp .env.example .env
echo " .env wurde aus .env.example erstellt. Bitte Werte prüfen."
else
echo "❌ Fehler: .env fehlt und keine .env.example vorhanden."
exit 1
fi
fi
echo "⬇️ Lade Container-Image..."
docker compose -f "$COMPOSE_FILE" pull
echo "🚀 Starte Container..."
docker compose -f "$COMPOSE_FILE" up -d
echo "✅ Deployment abgeschlossen."
docker compose -f "$COMPOSE_FILE" ps