Add downloading WooCommerce Memberships into docker-entrypoint.sh

[MAILPOET-4095]
This commit is contained in:
Jan Lysý
2022-01-31 16:53:52 +01:00
committed by Pavel Dohnal
parent 6ed1bdeaa1
commit 1e443ae295

View File

@ -79,6 +79,19 @@ if [[ ! -d "/wp-core/wp-content/plugins/woocommerce-subscriptions" ]]; then
unzip -q -o "$WOOCOMMERCE_SUBS_ZIP" -d /wp-core/wp-content/plugins/ unzip -q -o "$WOOCOMMERCE_SUBS_ZIP" -d /wp-core/wp-content/plugins/
fi fi
# Install WooCommerce Memberships
if [[ ! -d "/wp-core/wp-content/plugins/woocommerce-memberships" ]]; then
WOOCOMMERCE_MEMBERSHIPS_ZIP="/wp-core/wp-content/plugins/mailpoet/tests/plugins/woocommerce-memberships.zip"
if [ ! -f "$WOOCOMMERCE_MEMBERSHIPS_ZIP" ]; then
echo "WooCommerce Memberships plugin zip not found. Downloading WooCommerce Memberships plugin latest zip"
cd /project
./do download:woo-commerce-memberships-zip latest
cd /wp-core/wp-content/plugins
fi
echo "Unzip Woocommerce Memberships plugin from $WOOCOMMERCE_MEMBERSHIPS_ZIP"
unzip -q -o "$WOOCOMMERCE_MEMBERSHIPS_ZIP" -d /wp-core/wp-content/plugins/
fi
# add configuration # add configuration
CONFIG='' CONFIG=''
CONFIG+="define('WP_DEBUG', true);\n" CONFIG+="define('WP_DEBUG', true);\n"
@ -96,6 +109,7 @@ sed -i "s/define( *'WP_DEBUG', false *);/$CONFIG/" /wp-core/wp-config.php
# activate all plugins which source code want to access in tests runtime # activate all plugins which source code want to access in tests runtime
wp plugin activate woocommerce wp plugin activate woocommerce
wp plugin activate woocommerce-subscriptions wp plugin activate woocommerce-subscriptions
wp plugin activate woocommerce-memberships
# activate theme # activate theme
wp theme activate twentytwentyone wp theme activate twentytwentyone
@ -107,6 +121,7 @@ fi
# print info about installed plugins # print info about installed plugins
wp plugin get woocommerce wp plugin get woocommerce
wp plugin get woocommerce-subscriptions wp plugin get woocommerce-subscriptions
wp plugin get woocommerce-memberships
# activate MailPoet # activate MailPoet
wp plugin activate mailpoet/mailpoet.php wp plugin activate mailpoet/mailpoet.php