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.

46 lines
1.5 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: clone_repo.sh [live|stage|local]" "live stage local")"
  7. echoMainTitle "Cloning $env system repository"
  8. is_remote=$(if [ "$env" == "live" ] || [ "$env" == "stage" ]; then echo 1; else echo 0; fi)
  9. if [ "$is_remote" == "1" ]
  10. then
  11. addSSHKey "$env"
  12. ssh_user="$(getConfig "$env" "ssh_user")"
  13. ssh_domain="$(getConfig "$env" "ssh_domain")"
  14. httpdocs_path="$(getConfig "$env" "httpdocs_path")"
  15. httpdocs_git_subpath="$(getConfig "$env" "httpdocs_git_subpath")"
  16. has_git="$(ssh "$ssh_user"@"ssh_domain" "[ -d \"$httpdocs_path$httpdocs_git_subpath/.git\" ] && echo 1 || echo 0")"
  17. if [ "$has_git" == "1" ]
  18. then
  19. echoWarning "Git allready installed, aborting"
  20. else
  21. ssh "$ssh_user"@"ssh_domain" "cd $httpdocs_path$httpdocs_git_subpath && git clone \"$git_url\" ."
  22. ssh "$ssh_user"@"ssh_domain" "cd $httpdocs_path$httpdocs_git_subpath && git config credential.helper store"
  23. fi
  24. fi
  25. if [ "$is_remote" == "0" ]
  26. then
  27. has_git="$(if [ -d "$app_dir/git/$project_name" ]; then echo 1; else echo 0; fi)"
  28. if [ "$has_git" == "1" ]
  29. then
  30. echoWarning "Git allready installed, aborting"
  31. else
  32. git clone "$git_url" "$app_dir/git/$project_name"
  33. fi
  34. fi
  35. echoFinal "... git repository cloned"
  36. echo "Running postscript ..."
  37. postScript "$app_dir/bin/postscript/functions/clone_repo.sh"