您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 

67 行
3.2 KiB

  1. #!/bin/bash
  2. set -e
  3. # ══════════════════════════════════════════════════════════════════════
  4. # Konfiguration – einmalig anpassen
  5. # ══════════════════════════════════════════════════════════════════════
  6. # Verzeichnis des Git-Repos
  7. GIT_DIR="/var/www/vhosts/memap.de/httpdocs/timetracking/timetracking-git-repo"
  8. # Verzeichnis, aus dem die App tatsächlich läuft (Document Root eine Ebene drüber)
  9. APP_DIR="/var/www/vhosts/memap.de/httpdocs/timetracking/timetracking-copy"
  10. # Binaries
  11. PHP="/usr/bin/php8.2"
  12. COMPOSER="/usr/local/bin/composer"
  13. NPM="/usr/bin/npm"
  14. # ══════════════════════════════════════════════════════════════════════
  15. echo ""
  16. echo "╔══════════════════════════════════════╗"
  17. echo "║ spawntree Timetracker – Deploy ║"
  18. echo "╚══════════════════════════════════════╝"
  19. echo ""
  20. # ── 1. Git aktualisieren ───────────────────────────────────────────────
  21. echo "⏳ [1/7] Git pull..."
  22. git -C "$GIT_DIR" pull
  23. # ── 2. Dateien ins App-Verzeichnis synchronisieren ────────────────────
  24. echo "⏳ [2/7] Dateien synchronisieren..."
  25. rsync -av --delete \
  26. --exclude=".git" \
  27. --exclude="node_modules" \
  28. --exclude="var/cache" \
  29. --exclude="var/log" \
  30. --exclude=".env.local" \
  31. --exclude=".env.*.local" \
  32. "$GIT_DIR/" "$APP_DIR/"
  33. # ── 3. Composer Dependencies installieren ─────────────────────────────
  34. echo "⏳ [3/7] Composer install..."
  35. cd "$APP_DIR"
  36. "$COMPOSER" install --no-dev --optimize-autoloader --no-interaction
  37. # ── 4. Central-Migrationen ausführen ──────────────────────────────────
  38. echo "⏳ [4/7] Central-Migrationen..."
  39. "$PHP" bin/console doctrine:migrations:migrate --em=central --no-interaction
  40. # ── 5. Tenant-Schemas aktualisieren ───────────────────────────────────
  41. echo "⏳ [5/7] Tenant-Schemas aktualisieren..."
  42. "$PHP" bin/console app:update-tenant-schema
  43. # ── 6. Cache leeren ───────────────────────────────────────────────────
  44. echo "⏳ [6/7] Cache leeren..."
  45. "$PHP" bin/console cache:clear
  46. # ── 7. Assets bauen ───────────────────────────────────────────────────
  47. echo "⏳ [7/7] Assets bauen (npm)..."
  48. "$NPM" ci
  49. "$NPM" run build
  50. echo ""
  51. echo "✅ Deploy abgeschlossen."
  52. echo ""