Skip to content

Commit

Permalink
chore: docker entrypoint optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
HMKnapp committed Apr 26, 2022
1 parent 66ca7ab commit 0b177dc
Showing 1 changed file with 25 additions and 18 deletions.
43 changes: 25 additions & 18 deletions docker/wordpress/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function install_woocommerce() {

echo "Install Sample Data"
wp plugin install wordpress-importer --activate
wp import wp-content/plugins/woocommerce/sample-data/sample_products.xml --authors=create
wp import wp-content/plugins/woocommerce/sample-data/sample_products.xml --authors=create >& /dev/null &
}

function wp_set_array() {
Expand All @@ -69,26 +69,33 @@ function install_plugin() {
STR_PLUGIN=$(get_plugin.sh ${PLUGIN_URL} ${PLUGIN_VERSION})
PLUGIN_NAME=$(echo ${STR_PLUGIN} | cut -d'^' -f1)
PATH_TO_ZIP=$(echo ${STR_PLUGIN} | cut -d'^' -f2)
wp plugin install ${PATH_TO_ZIP} --activate
wp plugin install ${PATH_TO_ZIP} --activate
}

function setup_store() {
wp option set woocommerce_onboarding_opt_in "yes"
wp option set woocommerce_onboarding_profile ""
wp option set woocommerce_store_address "Store Street 11"
wp option set woocommerce_store_address_2 ""
wp option set woocommerce_store_city "Graz"
wp option set woocommerce_store_postcode "8020"
wp option set woocommerce_default_country "AT"
wp option set woocommerce_currency "EUR"
wp_set_array woocommerce_onboarding_profile skipped 1
wp theme install twentytwenty --activate &
wp post delete 2 --force &
wp post delete 1 --force &
wp option set woocommerce_onboarding_opt_in "yes" &
wp option set woocommerce_store_address "Store Street 11" &
wp option set woocommerce_store_address_2 "" &
wp option set woocommerce_store_city "Graz" &
wp option set woocommerce_store_postcode "8020" &
wp option set woocommerce_default_country "AT" &
wp option set woocommerce_currency "EUR" &
wp option set woocommerce_product_type "physical" &
wp option set woocommerce_allow_tracking "no" &
wp option set --format=json woocommerce_stripe_settings '{"enabled":"no","create_account":false,"email":false}' &
wp option set --format=json woocommerce_ppec_paypal_settings '{"reroute_requests":false,"email":false}' &
wp option set --format=json woocommerce_cheque_settings '{"enabled":"no"}' &
wp option set --format=json woocommerce_bacs_settings '{"enabled":"no"}' &
wp option set --format=json woocommerce_cod_settings '{"enabled":"no"}' &
# wp_set_array woocommerce_onboarding_profile skipped 1
wp option update page_on_front 5 &
wp option update show_on_front page &
wp option update blogdescription "QENTA Plugin DEMO" &
wait
wp wc --user=admin tool run install_pages
wp option update page_on_front 5
wp option update show_on_front page
wp option update blogdescription "QENTA Plugin DEMO"
wp theme install twentytwenty --activate
wp post delete 2 --force
wp post delete 1 --force
}

function change_api_url() {
Expand Down Expand Up @@ -164,7 +171,7 @@ else
fi
fi
if [[ ${CI} != 'true' ]]; then
print_info
(sleep 1; print_info) &
fi

_log "url=https://${WORDPRESS_URL}"
Expand Down

0 comments on commit 0b177dc

Please sign in to comment.