Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow loading the woocommerce premium plugin in the local dev environment #901

Merged
merged 1 commit into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# to override the environment, you can configure environment variables in a .env file saved in this directory.
# the following environment variables are supported:
# - PHP_VERSION (defaults to 8.1, must be a version that has an official docker container available)
# - BACKEND ('mariadb' or 'mysql', defaults to 'mariadb')
# - WORDPRESS_VERSION (defaults to latest (defined below))
# - PORT (the port to expose wordpress on, defaults to 3000)
# - WP_ADMIN_USER (the admin wordpress username, defaults to 'root')
# - WP_ADMIN_EMAIL (the admin user's email, defaults to '[email protected]')
# - WOOCOMMERCE (if set, installs and sets up woocommerce)
# - STRIPE_PUBLISHABLE_KEY (the test publishable key to use with a woocommerce install)
# - STRIPE_SECRET_KEY (the test secret key to use with a woocommerce install)
# - PHP_VERSION - defaults to 8.1, must be a version that has an official docker container available
# - BACKEND - 'mariadb' or 'mysql', defaults to 'mariadb'
# - WORDPRESS_VERSION - defaults to latest (defined below)
# - PORT - the port to expose wordpress on, defaults to 3000
# - WP_ADMIN_USER - the admin wordpress username, defaults to 'root'
# - WP_ADMIN_EMAIL - the admin user's email, defaults to '[email protected]'
# - WOOCOMMERCE - if set, installs and sets up woocommerce
# - STRIPE_PUBLISHABLE_KEY - the test publishable key to use with a woocommerce install
# - STRIPE_SECRET_KEY - the test secret key to use with a woocommerce install
# - WOOCOMMERCE_PIWIK_ANALYTICS - path to woocommerce-piwik-analytics repo clone to link to in wordpress

services:
# basic apache service
Expand All @@ -25,6 +26,7 @@ services:
- /var/www/html/matomo-for-wordpress/app/tmp
- ./scripts/local-dev-entrypoint.sh:/usr/src/entrypoint.sh
- ./docker/wp-cli:/.wp-cli
- "${WOOCOMMERCE_PIWIK_ANALYTICS:-/dev/null}:/var/www/html/woocommerce-piwik-analytics"
ports:
- "${PORT:-3000}:80"
environment:
Expand Down Expand Up @@ -55,6 +57,7 @@ services:
- /var/www/html/matomo-for-wordpress/app/tmp
- ./scripts/local-dev-entrypoint.sh:/usr/src/entrypoint.sh
- ./docker/wp-cli:/.wp-cli
- "${WOOCOMMERCE_PIWIK_ANALYTICS:-/dev/null}:/var/www/html/woocommerce-piwik-analytics"
environment:
WP_DB_HOST: "${BACKEND:-mariadb}"
WOOCOMMERCE: "$WOOCOMMERCE"
Expand Down Expand Up @@ -96,6 +99,7 @@ services:
- .:/var/www/html/matomo-for-wordpress
- /var/www/html/matomo-for-wordpress/app/tmp
- ./docker/wp-cli:/.wp-cli
- "${WOOCOMMERCE_PIWIK_ANALYTICS:-/dev/null}:/var/www/html/woocommerce-piwik-analytics"
ports:
- "${PORT:-3000}:80"
environment:
Expand Down
4 changes: 4 additions & 0 deletions scripts/local-dev-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ if [ ! -d "/var/www/html/$WORDPRESS_VERSION/wp-content/plugins/matomo" ]; then
ln -s /var/www/html/matomo-for-wordpress "/var/www/html/$WORDPRESS_VERSION/wp-content/plugins/matomo"
fi

if [[ -d "/var/www/html/woocommerce-piwik-analytics" && ! -d "/var/www/html/$WORDPRESS_VERSION/wp-content/plugins/woocommerce-piwik-analytics" ]]; then
ln -s /var/www/html/woocommerce-piwik-analytics /var/www/html/$WORDPRESS_VERSION/wp-content/plugins/woocommerce-piwik-analytics
fi

/var/www/html/wp-cli.phar --allow-root --path=/var/www/html/$WORDPRESS_VERSION plugin activate matomo

# add index.php file listing available installs to root /var/www/html
Expand Down
Loading