Browse Source

change

master
Sven Ullmann 1 year ago
parent
commit
65604a9e39
  1. 10
      bin/commands/create-project
  2. 71
      bin/commands/install-plugin
  3. 0
      plugins/db/etc/config
  4. 4
      plugins/db/etc/live.my.cnf
  5. 22
      plugins/db/etc/stage.my.cnf
  6. 4
      plugins/db/includes/includes
  7. 0
      plugins/git/etc/config
  8. 0
      plugins/plesk/etc/config
  9. 70
      plugins/shopware5/etc/config
  10. 19
      plugins/shopware5/includes/includes
  11. 0
      plugins/shopware6/etc/config
  12. 0
      plugins/ssh/etc/config

10
bin/commands/create-project

@ -116,15 +116,7 @@ plugin_path="$project_manager_dir/plugins"
plugins=$(ls -t "$plugin_path") plugins=$(ls -t "$plugin_path")
for plugin in ${plugins[*]} for plugin in ${plugins[*]}
do do
etc_file="$plugin_path/$plugin/etc/.config_template"
if [ -f "$etc_file" ] && [ ! -f "$path/etc/plugins/$plugin/config" ]
then
if [ ! -d "$path/etc/plugins/$plugin" ]
then
mkdir "$path/etc/plugins/$plugin"
fi
cp "$etc_file" "$path/etc/plugins/$plugin/config"
fi
"$project_manager_dir/bin/commands/install-plugin" "$shortname" "$plugin"
done done
if [ ! -d "$workspaces_dir/$customer/$project" ]; then mkdir -p "$workspaces_dir/$customer/$project"; fi if [ ! -d "$workspaces_dir/$customer/$project" ]; then mkdir -p "$workspaces_dir/$customer/$project"; fi

71
bin/commands/install-plugin

@ -0,0 +1,71 @@
#!/bin/bash
### DO NOT EDIT THIS FILE
source "$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." &> /dev/null && pwd)/etc/config"
source "$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." &> /dev/null && pwd)/etc/projects"
function usage {
echo
echoMainTitle "Installs a plugin"
echo
echoSubTitle "Usage:"
echo
echo "install-plugin [shortname] [plugin]"
echo
echo "--help Prints this message"
echo " "
}
help="$(getParameter "--help" false "$*")"
if [ "$help" == true ] || [ "$1" == "" ]
then
usage
exit
fi
shortname=$(getArgument "$1" "$(usage)" true)
plugin=$(getArgument "$2" "$(usage)" true)
customer=$(getCustomerFromShortname "$shortname")
project=$(getProjectFromShortname "$shortname")
project_dir="$project_manager_dir/data/$customer/$project"
plugin_dir="$project_manager_dir/plugins/$plugin"
if [ ! -d "$project_dir" ]
then
echo
echoError "Could not find project dir"
echo
exit
fi
if [ ! -d "$plugin_dir" ]
then
echo
echoError "Could not find plugin dir"
echo
exit
fi
echo
echoMainTitle "Install plugin"
if [ ! -d "$project_dir/etc/plugins/$plugin" ]
then
mkdir "$project_dir/etc/plugins/$plugin"
fi
etc_files=$(list "$plugin/etc")
for etc_file in "${etc_files[@]}"
do
cp "$etc_file" "$project_dir/etc/plugins/$plugin/config"
done
echo
echoSubTitle "Running postscripts ..."
postScript "$project_manager_dir/bin/postscripts/commands/install-plugin"
postScript "$project_dir/bin/postscripts/commands/install-plugin"
echo
echoSuccess "Plugin has been installed, please configure: $project_dir/etc/plugins/$plugin"
echo

0
plugins/db/etc/.config_template → plugins/db/etc/config

4
plugins/db/etc/.my.cnf_template → plugins/db/etc/live.my.cnf

@ -14,5 +14,9 @@ host=
port= port=
[client] [client]
user=
password=
[clientadmin] [clientadmin]
user=
password=

22
plugins/db/etc/stage.my.cnf

@ -0,0 +1,22 @@
### DO NOT EDIT THIS FILE
[mysqldump]
max_allowed_packet=500M
socket=
host=
port=
[mysql]
max_allowed_packet=500M
socket=
host=
port=
[client]
user=
password=
[clientadmin]
user=
password=

4
plugins/db/includes/includes

@ -45,7 +45,7 @@ function dbDump {
local ssh_domain="$(sshGetConfig "$env" "domain")" local ssh_domain="$(sshGetConfig "$env" "domain")"
sshAddKey "$env" sshAddKey "$env"
scp "$app_dir/etc/$env.my.cnf" "$ssh_user"@"$ssh_domain":"~/$env.my.cnf"
scp "$app_dir/etc/plugins/db/$env.my.cnf" "$ssh_user"@"$ssh_domain":"~/$env.my.cnf"
ssh "$ssh_user"@"$ssh_domain" "mysqldump --defaults-extra-file=~/$env.my.cnf --no-tablespaces ${parameters[*]} $database $tables | \ ssh "$ssh_user"@"$ssh_domain" "mysqldump --defaults-extra-file=~/$env.my.cnf --no-tablespaces ${parameters[*]} $database $tables | \
LANG=C LC_CTYPE=C LC_ALL=C sed -e 's/DEFINER[ ]*=[ ]*[^*]*\*/\*/' | \ LANG=C LC_CTYPE=C LC_ALL=C sed -e 's/DEFINER[ ]*=[ ]*[^*]*\*/\*/' | \
sed -e 's/,NO_AUTO_CREATE_USER//' | gzip -9 > ~/${env}_$name.sql.gz" sed -e 's/,NO_AUTO_CREATE_USER//' | gzip -9 > ~/${env}_$name.sql.gz"
@ -54,7 +54,7 @@ function dbDump {
gunzip "$app_dir/var/tmp/$currentDate-${env}_$name.sql.gz" gunzip "$app_dir/var/tmp/$currentDate-${env}_$name.sql.gz"
else else
mysqldump --defaults-extra-file="$app_dir/etc/${env}.my.cnf" --no-tablespaces ${parameters[*]} $database $tables | \
mysqldump --defaults-extra-file="$app_dir/plugins/db/etc/${env}.my.cnf" --no-tablespaces ${parameters[*]} $database $tables | \
LANG=C LC_CTYPE=C LC_ALL=C sed -e 's/DEFINER[ ]*=[ ]*[^*]*\*/\*/' | sed -e 's/,NO_AUTO_CREATE_USER//' \ LANG=C LC_CTYPE=C LC_ALL=C sed -e 's/DEFINER[ ]*=[ ]*[^*]*\*/\*/' | sed -e 's/,NO_AUTO_CREATE_USER//' \
> "$app_dir/var/tmp/${currentDate}-${env}_$name.sql" > "$app_dir/var/tmp/${currentDate}-${env}_$name.sql"
fi fi

0
plugins/git/etc/.config_template → plugins/git/etc/config

0
plugins/plesk/etc/.config_template → plugins/plesk/etc/config

70
plugins/shopware5/etc/config

@ -0,0 +1,70 @@
#!/bin/bash
### GENERAL
shopware5_httpdocs_subpath=''
shopware5_local_user=''
shopware5_local_email=''
shopware5_local_firstname=''
shopware5_local_lastname=''
shopware5_install_name=''
shopware5_install_email=''
shopware5_install_locale=''
shopware5_install_currency=''
shopware5_install_storefront_name=''
shopware5_install_storefront_url=''
### URL MAPPING
shopware5_live_urls=()
shopware5_stage_urls=()
shopware5_local_urls=()
### GDPR SHOPWARE 6 TABLES
shopware5_gdpr_tables=(
s_user
s_user_addresses
s_user_addresses_attributes
s_user_attributes
s_user_billingaddress
s_user_billingaddress_attributes
s_user_shippingaddress
s_user_shippingaddress_attributes
s_customer_search_index
s_customer_streams
s_customer_streams_attributes
s_customer_streams_mapping
s_mail_log
s_mail_log_contact
s_mail_log_document
s_mail_log_recipient
s_order_attributes
s_order_basket
s_order_basket_attributes
s_order_billingaddress
s_order_billingaddress_attributes
s_order_comparisons
s_order_details
s_order_details_attributes
s_order_documents
s_order_documents_attributes
s_order_esd
s_order_history
s_order_notes
s_order_shippingaddress
s_order_shippingaddress_attributes
)
### Media Files
shopware5_shared_files=(
'/files'
'/media'
)
### MAILER
shopware5_local_mailer_url=''

19
plugins/shopware5/includes/includes

@ -0,0 +1,19 @@
#!/bin/bash
### DO NOT EDIT THIS FILE
function shopware5BuildIgnoredTablesArguments {
local env=$(getArgument "$1" "Usage: buildIgnoredTables [live|stage|local] [ignoredTablesArray]" "live stage local")
local ignoredTables=$(getArgument "$2" "Usage: buildIgnoredTables [live|stage|local] [ignoredTablesArray]" true)
local database_name=$(eval "echo \"\$${env}_database_name\"")
ignoredTables=($ignoredTables)
local ignoredTablesArguments=""
for table in "${ignoredTables[@]}"
do
ignoredTablesArguments="$ignoredTablesArguments --ignore-table=\"${database_name}.${table}\""
done
echo "$ignoredTablesArguments"
}

0
plugins/shopware6/etc/.config_template → plugins/shopware6/etc/config

0
plugins/ssh/etc/.config_template → plugins/ssh/etc/config

Loading…
Cancel
Save