Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 

87 lignes
2.0 KiB

  1. #!/bin/bash
  2. # Die zwei Hauptpfade als Variablen
  3. TARGET_PATH="/var/www/crm-api/httpdocs"
  4. GIT_PATH="/var/www/matsen-git-repository/matsen-tool-be"
  5. # Git Pull durchführen
  6. cd ${GIT_PATH}
  7. sudo git pull
  8. echo "$(tput setab 2)matsen api has been PULLED$(tput sgr 0)"
  9. # Arrays für Dateien und Verzeichnisse, die kopiert werden sollen
  10. CONFIG_FILES=(
  11. "bundles.php"
  12. "preload.php"
  13. "routes.yaml"
  14. "services.yaml"
  15. )
  16. CONFIG_DIRS=(
  17. "packages"
  18. "routes"
  19. )
  20. ROOT_DIRS=(
  21. "bin"
  22. "migrations"
  23. "src"
  24. )
  25. # Composer-Dateien kopieren
  26. rm -rf ${TARGET_PATH}/composer.lock
  27. rm -rf ${TARGET_PATH}/composer.json
  28. cp -rf ${GIT_PATH}/composer.json ${TARGET_PATH}
  29. # Config-Dateien kopieren
  30. for file in "${CONFIG_FILES[@]}"; do
  31. rm -rf ${TARGET_PATH}/config/${file}
  32. cp -rf ${GIT_PATH}/config/${file} ${TARGET_PATH}/config/
  33. done
  34. # Config-Verzeichnisse kopieren
  35. for dir in "${CONFIG_DIRS[@]}"; do
  36. rm -rf ${TARGET_PATH}/config/${dir}
  37. cp -rf ${GIT_PATH}/config/${dir} ${TARGET_PATH}/config/
  38. done
  39. # Root-Verzeichnisse kopieren
  40. for dir in "${ROOT_DIRS[@]}"; do
  41. rm -rf ${TARGET_PATH}/${dir}
  42. cp -rf ${GIT_PATH}/${dir} ${TARGET_PATH}/
  43. done
  44. # Index.php kopieren
  45. rm -rf ${TARGET_PATH}/public/index.php
  46. cp -rf ${GIT_PATH}/public/index.php ${TARGET_PATH}/public
  47. echo "$(tput setab 2)Files have been copied$(tput sgr 0)"
  48. # Composer Update und Datenbank-Migration
  49. cd ${TARGET_PATH}
  50. composer update --no-scripts
  51. echo "$(tput setab 2)COMPOSER UPDATED updated$(tput sgr 0)"
  52. php ${TARGET_PATH}/bin/console doctrine:migrations:migrate
  53. echo "$(tput setab 2)DATABASE SCHEMA updated$(tput sgr 0)"
  54. # Cache leeren und neu aufbauen
  55. cd ${TARGET_PATH}/var/cache/
  56. rm -R *
  57. php ${TARGET_PATH}/bin/console cache:clear
  58. php ${TARGET_PATH}/bin/console cache:warmup
  59. echo "$(tput setab 2)CACHE HAS BEEN CLEARED$(tput sgr 0)"
  60. cd ${TARGET_PATH}/var/
  61. sudo chmod 777 -R *
  62. sudo chmod 777 cache/ *
  63. sudo chmod 777 cache/
  64. echo "$(tput setab 7)$(tput setaf 1)THINK ABOUT POSSIBLE PATCHES!"
  65. echo "You have updated matsen api!$(tput sgr 0)"