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.

49 lines
2.4 KiB

  1. #!/bin/bash
  2. ### DO NOT EDIT THIS FILE
  3. function shopware6BuildIgnoredTablesArguments {
  4. local env=$(getArgument "$1" "Usage: buildIgnoredTables [live|stage|local] [ignoredTablesArray]" "live stage local")
  5. local ignoredTables=$(getArgument "$2" "Usage: buildIgnoredTables [live|stage|local] [ignoredTablesArray]" true)
  6. local database_name=$(eval "echo \"\$${env}_database_name\"")
  7. ignoredTables=($ignoredTables)
  8. local ignoredTablesArguments=""
  9. for table in "${ignoredTables[@]}"
  10. do
  11. ignoredTablesArguments="$ignoredTablesArguments --ignore-table=\"${database_name}.${table}\""
  12. done
  13. echo "$ignoredTablesArguments"
  14. }
  15. function shopware6GetSecret {
  16. local prop="$(getArgument "$1" "Usage: getSecret [APP_SECRET|INSTANCE_ID]" "APP_SECRET INSTANCE_ID")"
  17. local httpdocs_shopware_subpath="$(getConfig "local" "httpdocs_shopware_subpath")"
  18. local path="$app_dir/git/$project_name$httpdocs_shopware_subpath"
  19. app_secret="$(cat "$app_dir/etc/app_secret")"
  20. app_secret="$(if [ "$app_secret" == "" ]; then echo "$(_shopware6GetRemoteSecret "live" "$prop")"; else echo "$app_secret"; fi)"
  21. app_secret="$(if [ "$app_secret" == "" ]; then echo "$(_shopware6GetRemoteSecret "stage" "$prop")"; else echo "$app_secret"; fi)"
  22. app_secret="$(if [ "$app_secret" == "" ]; then echo "$(cat \""$path/.env"\" | sed -i -r "s/^$prop=\(.*\)\$/\\1/")"; else echo "$app_secret"; fi)"
  23. app_secret="$(if [ "$app_secret" == "" ]; then echo "$(_shopware6GenerateSecret)"; else echo "$app_secret"; fi)"
  24. }
  25. function _shopware6GetRemoteSecret {
  26. local env="$(getArgument "$1" "Usage: _getRemoteSecret [live|stage] [APP_SECRET|INSTANCE_ID]" "live stage")"
  27. local prop="$(getArgument "$2" "Usage: _getRemoteSecret [live|stage] [APP_SECRET|INSTANCE_ID]" "APP_SECRET INSTANCE_ID")"
  28. local ssh_user="$(getConfig "$env" "ssh_user")"
  29. local ssh_domain="$(getConfig "$env" "ssh_domain")"
  30. local httpdocs_path="$(getConfig "$env" "httpdocs_path")"
  31. local httpdocs_git_subpath="$(getConfig "$env" "httpdocs_git_subpath")"
  32. local httpdocs_shopware_subpath="$(getConfig "$env" "httpdocs_shopware_subpath")"
  33. local path="$httpdocs_path$httpdocs_git_subpath$httpdocs_shopware_subpath"
  34. addSSHKey "$env"
  35. echo "$(ssh "$ssh_user"@"$ssh_domain" "cat \"$path/.env"\" | sed -i -r "s/^$prop=\(.*\)\$/\\1/")"
  36. }
  37. function _shopware6GenerateSecret {
  38. echo openssl rand -hex 32
  39. }