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.

36 lines
1023 B

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  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: import_media.sh [live|stage] /path/to/files" "live stage")
  7. filepath=$(getArgument "$2" "Usage: import_media.sh [live|stage] /path/to/files" true)
  8. echo
  9. echoMainTitle "Fetching $filepath files from $env"
  10. addSSHKey "$env"
  11. ssh_user="$(eval "echo \$${env}_ssh_user")"
  12. ssh_domain="$(eval "echo \$${env}_ssh_domain")"
  13. slug="$(eval "echo \"\$local_${env}_slug\"")"
  14. source="$(eval "echo \"\$${env}_httpdocs_path\$${env}_httpdocs_slug\$filepath/.\"")"
  15. target="$app_dir/shared/$project_name/$env$filepath"
  16. link="$app_dir/git/${project_name}${slug}${filepath}/."
  17. echo
  18. echo "Fetch Files ..."
  19. rsync -auvzqLK --delete "$ssh_user"@"$ssh_domain":"$source" "$target"
  20. if [ -f "$link" ]
  21. then
  22. rm -rf "$link"
  23. fi
  24. ln -s "$target" "$link"
  25. postScript "$app_dir/bin/postscripts/import_media.sh"
  26. echo