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.

38 lines
1.2 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: fetch_files.sh [live|stage]" "live stage")"
  7. ssh_user="$(getConfig "$env" "ssh_user")"
  8. ssh_domain="$(getConfig "$env" "ssh_domain")"
  9. httpdocs_path="$(getConfig "$env" "httpdocs_path")"
  10. httpdocs_git_subpath="$(getConfig "$env" "httpdocs_git_subpath")"
  11. httpdocs_shopware_subpath="$(getConfig "$env" "httpdocs_shopware_subpath")"
  12. remote_path="$httpdocs_path$httpdocs_git_subpath$httpdocs_shopware_subpath"
  13. local_path="$app_dir/git/$project_name/$local_httpdocs_shopware_subpath"
  14. shared_path="$app_dir/shared/$project_name/$env"
  15. echoMainTitle "Fetching $env system files"
  16. for file in "${shared_files[@]}"
  17. do
  18. echo "Fetching files $file"
  19. addSSHKey "$env"
  20. scp "$ssh_user"@"$ssh_domain":"$remote_path/$file/." "$shared_path/$file/."
  21. if [ -f "$local_path/$file" ]
  22. then
  23. rm -rf "$local_path/$file"
  24. fi
  25. ln -s "$shared_path/$file" "$local_path/$file"
  26. done
  27. echoFinal "... files fetched"
  28. echo "Running postscript ..."
  29. postScript "$app_dir/bin/postscripts/function/fetch_files.sh"