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.

25 lines
893 B

2 years ago
  1. #!/bin/bash
  2. source "$(dirname "${BASH_SOURCE[0]}")/../includes/includes.sh"
  3. app_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." &> /dev/null && pwd)
  4. source "$app_dir/etc/config.sh"
  5. env=$(getArgument "$1" "Usage: import_media.sh [live|stage] /path/to/files" "live stage")
  6. filepath=$(getArgument "$2" "Usage: import_media.sh [live|stage] /path/to/files" "/files /public/media")
  7. addSSHKey "$env"
  8. ssh_user="$(eval "echo \$${env}_ssh_user")"
  9. ssh_domain="$(eval "echo \$${env}_ssh_domain")"
  10. slug="$(eval "echo \"\$local_${env}_slug\"")"
  11. source="$(eval "echo \"\$${env}_httpdocs_path\$${env}_httpdocs_slug\$filepath/.\"")"
  12. target="$app_dir/git/${project_name}${slug}${filepath}/."
  13. echo
  14. echoMainTitle "Fetching $filepath files from $env"
  15. echo
  16. echo "Fetch Files ..."
  17. rsync -auvzqLK --delete "$ssh_user"@"$ssh_domain":"$source" "$target"
  18. postScript "$app_dir/bin/postscripts/import_media.sh"
  19. echo