Ein für Shopware 6 vorbereitet Systemmanagment.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.6 KiB

  1. #!/bin/bash
  2. ### DO NOT EDIT THIS FILE
  3. source "$(dirname "${BASH_SOURCE[0]}")/../includes/includes.sh"
  4. app_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." &> /dev/null && pwd)
  5. source "$app_dir/etc/config.sh"
  6. env="$(getArgument "$1" "Usage: create_directories.sh [live|stage]" "live stage")"
  7. echoMainTitle "Installing $env system directories"
  8. addSSHKey "$env"
  9. httpdocs_path="$(getConfig "$env" "httpdocs_path")"
  10. httpdocs_git_subpath="$(getConfig "$env" "httpdocs_git_subpath")"
  11. ssh_user="$(getConfig "$env" "ssh_user")"
  12. ssh_domain="$(getConfig "$env" "ssh_domain")"
  13. database_name="$(getConfig "$env" "database_name")"
  14. has_httpdocs_path="$(ssh "$ssh_user"@"ssh_domain" "[ -d \"$httpdocs_path\" ] && echo 1 || echo 0")"
  15. has_httpdocs_git_path="$(ssh "$ssh_user"@"ssh_domain" "[ -d \"$httpdocs$httpdocs_git_subpath\" ] && echo 1 || echo 0")"
  16. if [ "$has_httpdocs" == "0" ]
  17. then
  18. create_httpdocs="$(readConsole "The $env System has no httpdocs ($httpdocs_path), should i create it [y,n]" "Invalid selection" "y n")"
  19. if [ "$create_httpdocs" == "y" ]
  20. then
  21. ssh "$ssh_user"@"ssh_domain" "mkdir -p \"$httpdocs_path\""
  22. fi
  23. fi
  24. if [ "$has_httpdocs_git_path" == "0" ]
  25. then
  26. create_git="$(readConsole "The $env System has no subpath to git directory ($httpdocs_path$httpdocs_git_path), should i create it [y,n]" "Invalid selection" "y n")"
  27. if [ "$create_git" == "y" ]
  28. then
  29. ssh "$ssh_user"@"ssh_domain" "mkdir -p \"$httpdocs_path$httpdocs_git_subpath\""
  30. fi
  31. fi
  32. echoFinal "... directories created"
  33. echo "Running postscript ..."
  34. postScript "$app_dir/bin/postscript//create_directories.sh"