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.
 
 

37 lines
1023 B

#!/bin/bash
### DO NOT EDIT THIS FILE
source "$(dirname "${BASH_SOURCE[0]}")/../includes/includes.sh"
app_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." &> /dev/null && pwd)
source "$app_dir/etc/config.sh"
env=$(getArgument "$1" "Usage: import_media.sh [live|stage] /path/to/files" "live stage")
filepath=$(getArgument "$2" "Usage: import_media.sh [live|stage] /path/to/files" true)
echo
echoMainTitle "Fetching $filepath files from $env"
addSSHKey "$env"
ssh_user="$(eval "echo \$${env}_ssh_user")"
ssh_domain="$(eval "echo \$${env}_ssh_domain")"
slug="$(eval "echo \"\$local_${env}_slug\"")"
source="$(eval "echo \"\$${env}_httpdocs_path\$${env}_httpdocs_slug\$filepath/.\"")"
target="$app_dir/shared/$project_name/$env$filepath"
link="$app_dir/git/${project_name}${slug}${filepath}/."
echo
echo "Fetch Files ..."
rsync -auvzqLK --delete "$ssh_user"@"$ssh_domain":"$source" "$target"
if [ -f "$link" ]
then
rm -rf "$link"
fi
ln -s "$target" "$link"
postScript "$app_dir/bin/postscripts/import_media.sh"
echo