install.bat 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. @echo off
  2. REM Update repositories
  3. call :update_repository "https://git.sharix-app.org/ShariX_Open/sharix-open-tickets.git" "tickets" "master"
  4. call :update_repository "https://git.sharix-app.org/ShariX_Open/sharix-open-backend.git" "metaservicesynced" "metasynced_module"
  5. call :update_repository "https://git.sharix-app.org/ShariX_Open/sharix-open-config.git" "conf" "master"
  6. call :update_repository "https://git.sharix-app.org/ShariX_Open/sharix-open-webapp-design-template.git" "design_template" "unstable"
  7. call :update_repository "https://git.sharix-app.org/ShariX_Open/sharix-open-webservice-running.git" "webservice_running" "unstable"
  8. call :update_repository "https://git.sharix-app.org/ShariX_Open/sharix-open-landing.git" "landing" "landing_module"
  9. git pull
  10. REM Create a Python virtual environment and activate it
  11. python -m venv venv
  12. call venv\Scripts\activate
  13. REM Upgrade pip and install requirements
  14. python -m pip install --upgrade pip
  15. python -m pip install -r requirements.txt
  16. REM Checking for core/settings_vars.py
  17. if exist core\settings_vars.py (
  18. echo File settings_vars.py already exists
  19. ) else (
  20. copy core\_settings_vars.py core\settings_vars.py
  21. echo File settings_vars.py was successfully created
  22. )
  23. REM Run Django migrations and other commands
  24. python -m manage.py makemigrations SharixAdmin metaservicesynced tickets webservice_running landing
  25. python -m manage.py migrate
  26. python -m manage.py collectstatic --clear --no-input
  27. goto :eof
  28. REM Function to check if a repository exists and perform git pull or git clone
  29. :update_repository
  30. setlocal
  31. set "repo_url=%~1"
  32. set "repo_dir=%~2"
  33. set "repo_branch=%~3"
  34. if exist "%repo_dir%" (
  35. rem If the directory exists, then do a git pull
  36. echo Updating %repo_dir%...
  37. cd "%repo_dir%" || exit /b
  38. git pull
  39. cd ..
  40. ) else (
  41. rem If the directory does not exist, then do a git clone
  42. echo Cloning %repo_url% into %repo_dir%...
  43. git clone -b %repo_branch% %repo_url% %repo_dir%
  44. )
  45. endlocal
  46. goto :eof