-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
234 changed files
with
9,699 additions
and
4,251 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v20 | ||
20.11 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,20 +14,19 @@ redirect_output() { | |
fi | ||
} | ||
|
||
# --user xfs forces the wordpress:cli container to use a user with the same ID as the main wordpress container. See: | ||
# https://hub.docker.com/_/wordpress#running-as-an-arbitrary-user | ||
cli() | ||
{ | ||
INTERACTIVE='' | ||
if [ -t 1 ] ; then | ||
INTERACTIVE='-it' | ||
fi | ||
redirect_output docker run $INTERACTIVE --env-file default.env --rm --user xfs --volumes-from $WP_CONTAINER --network container:$WP_CONTAINER wordpress:cli "$@" | ||
|
||
redirect_output docker exec $INTERACTIVE --env-file default.env --user www-data $WP_CONTAINER "$@" | ||
} | ||
|
||
set +e | ||
# Wait for containers to be started up before the setup. | ||
# The db being accessible means that the db container started and the WP has been downloaded and the plugin linked | ||
# The db being accessible means that the db container started and the WP has been downloaded and the plugin linked | ||
cli wp db check --path=/var/www/html --quiet > /dev/null | ||
while [[ $? -ne 0 ]]; do | ||
echo "Waiting until the service is ready..." | ||
|
@@ -40,7 +39,7 @@ cli wp plugin is-active woocommerce-payments > /dev/null | |
if [[ $? -eq 0 ]]; then | ||
set -e | ||
echo | ||
echo "WCPay is installed and active" | ||
echo "WooPayments is installed and active" | ||
echo "SUCCESS! You should now be able to access http://${SITE_URL}/wp-admin/" | ||
echo "You can login by using the username and password both as 'admin'" | ||
exit 0 | ||
|
@@ -52,9 +51,6 @@ echo | |
echo "Setting up environment..." | ||
echo | ||
|
||
echo "Pulling the WordPress CLI docker image..." | ||
docker pull wordpress:cli > /dev/null | ||
|
||
echo "Setting up WordPress..." | ||
cli wp core install \ | ||
--path=/var/www/html \ | ||
|
@@ -72,19 +68,19 @@ echo "Updating the WordPress database..." | |
cli wp core update-db --quiet | ||
|
||
echo "Configuring WordPress to work with ngrok (in order to allow creating a Jetpack-WPCOM connection)"; | ||
cli config set DOCKER_HOST "\$_SERVER['HTTP_X_ORIGINAL_HOST'] ?? \$_SERVER['HTTP_HOST'] ?? 'localhost'" --raw | ||
cli config set DOCKER_REQUEST_URL "( ! empty( \$_SERVER['HTTPS'] ) ? 'https://' : 'http://' ) . DOCKER_HOST" --raw | ||
cli config set WP_SITEURL DOCKER_REQUEST_URL --raw | ||
cli config set WP_HOME DOCKER_REQUEST_URL --raw | ||
cli wp config set DOCKER_HOST "\$_SERVER['HTTP_X_ORIGINAL_HOST'] ?? \$_SERVER['HTTP_HOST'] ?? 'localhost'" --raw | ||
cli wp config set DOCKER_REQUEST_URL "( ! empty( \$_SERVER['HTTPS'] ) ? 'https://' : 'http://' ) . DOCKER_HOST" --raw | ||
cli wp config set WP_SITEURL DOCKER_REQUEST_URL --raw | ||
cli wp config set WP_HOME DOCKER_REQUEST_URL --raw | ||
|
||
echo "Enabling WordPress debug flags" | ||
cli config set WP_DEBUG true --raw | ||
cli config set WP_DEBUG_DISPLAY true --raw | ||
cli config set WP_DEBUG_LOG true --raw | ||
cli config set SCRIPT_DEBUG true --raw | ||
cli wp config set WP_DEBUG true --raw | ||
cli wp config set WP_DEBUG_DISPLAY true --raw | ||
cli wp config set WP_DEBUG_LOG true --raw | ||
cli wp config set SCRIPT_DEBUG true --raw | ||
|
||
echo "Enabling WordPress development environment (enforces Stripe testing mode)"; | ||
cli config set WP_ENVIRONMENT_TYPE development | ||
cli wp config set WP_ENVIRONMENT_TYPE development | ||
|
||
echo "Updating permalink structure" | ||
cli wp rewrite structure '/%postname%/' | ||
|
@@ -114,26 +110,29 @@ cli wp plugin install wordpress-importer --activate | |
echo "Importing some sample data..." | ||
cli wp import wp-content/plugins/woocommerce/sample-data/sample_products.xml --authors=skip | ||
|
||
echo "Activating the WooCommerce Payments plugin..." | ||
echo "Activating the WooPayments plugin..." | ||
cli wp plugin activate woocommerce-payments | ||
|
||
echo "Setting up WooCommerce Payments..." | ||
echo "Setting up WooPayments..." | ||
if [[ "0" == "$(cli wp option list --search=woocommerce_woocommerce_payments_settings --format=count)" ]]; then | ||
echo "Creating WooCommerce Payments settings" | ||
echo "Creating WooPayments settings" | ||
cli wp option add woocommerce_woocommerce_payments_settings --format=json '{"enabled":"yes"}' | ||
else | ||
echo "Updating WooCommerce Payments settings" | ||
echo "Updating WooPayments settings" | ||
cli wp option update woocommerce_woocommerce_payments_settings --format=json '{"enabled":"yes"}' | ||
fi | ||
|
||
echo "Installing and activating Disable WordPress Updates..." | ||
cli wp plugin install disable-wordpress-updates --activate | ||
|
||
echo "Installing dev tools plugin..." | ||
set +e | ||
git clone [email protected]:Automattic/woocommerce-payments-dev-tools.git docker/wordpress/wp-content/plugins/woocommerce-payments-dev-tools | ||
if [[ $? -eq 0 ]]; then | ||
cli wp plugin activate woocommerce-payments-dev-tools | ||
else | ||
echo | ||
echo "WARN: Could not access the dev tools repository. Skipping the install." | ||
echo "WARN: Could not clone the dev tools repository. Skipping the install." | ||
fi; | ||
set -e | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.