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.

33 lines
1.1 KiB

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. usage="Usage: make_local_database.sh [live|stage]"
  7. env=$(getArgument "$1" "$usage" "live stage")
  8. local_database_name=$(eval "echo \"\$local_${env}_database_name\"")
  9. echo
  10. echoMainTitle "Make Local Database"
  11. echo
  12. echo "Perform Database Changes ..."
  13. live_urls=$(eval "echo \"\$${env}_to_local_${env}_urls\"")
  14. local_urls=$(eval "echo \"\$${env}_to_local_local_urls\"")
  15. for i in "${!live_urls[@]}"
  16. do
  17. mysql --defaults-extra-file="$app_dir/etc/local.my.cnf" -D "$local_database_name" -e \
  18. "UPDATE sales_channel_domain SET url = '${local_urls[$i]}' WHERE url = '${live_urls[$i]}'"
  19. done
  20. script="$(eval "echo \"$app_dir/git/$project_name\$local_${env}_slug/bin/console\"")"
  21. "$script" user:create -a --email="$local_shopware_email" --firstName="$local_shopware_firstname" --lastName="$local_shopware_lastname" "$local_shopware_user"
  22. postScript "$app_dir/bin/postscripts/make_local_database.sh"
  23. echo