Skip to content

Commit

Permalink
Merge pull request ampproject#7602 from ampproject/remove/custom-gb-p…
Browse files Browse the repository at this point in the history
…lugin-installation

Revert custom GB 16.3 installation steps and add WP_DEBUG support in local-env
  • Loading branch information
westonruter authored Aug 31, 2023
2 parents b16d220 + 72656b2 commit f5304e2
Show file tree
Hide file tree
Showing 9 changed files with 336 additions and 38 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build-test-measure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,7 @@ jobs:
composer require --ignore-platform-reqs --no-interaction --no-scripts phpunit/php-token-stream:^3.1.3 --with-dependencies
elif [[ $PHP_VERSION == "7.3" || $PHP_VERSION == "7.4" || $PHP_VERSION == "8.0" ]]; then
echo "Installing PHPUnit 9.3"
composer update --ignore-platform-reqs --no-interaction --no-scripts yoast/phpunit-polyfills --with-dependencies
composer require --dev --ignore-platform-reqs phpunit/phpunit:"9.3.*" --with-dependencies
elif [[ $WP_VERSION == "latest" || $WP_VERSION == "trunk" || $PHP_VERSION == "8.1" || $PHP_VERSION == "8.2" ]]; then
echo "Installing latest version of PHPUnit"
Expand Down
17 changes: 10 additions & 7 deletions .phpstorm.meta.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,23 @@
'admin.onboarding_menu' => \AmpProject\AmpWP\Admin\OnboardingWizardSubmenu::class,
'admin.onboarding_wizard' => \AmpProject\AmpWP\Admin\OnboardingWizardSubmenuPage::class,
'admin.options_menu' => \AmpProject\AmpWP\Admin\OptionsMenu::class,
'admin.support_screen' => \AmpProject\AmpWP\Admin\SupportScreen::class,
'admin.support' => \AmpProject\AmpWP\Admin\SupportLink::class,
'admin.paired_browsing' => \AmpProject\AmpWP\Admin\PairedBrowsing::class,
'admin.plugin_row_meta' => \AmpProject\AmpWP\Admin\PluginRowMeta::class,
'admin.support_screen' => \AmpProject\AmpWP\Admin\SupportScreen::class,
'admin.support' => \AmpProject\AmpWP\Admin\SupportLink::class,
'admin.polyfills' => \AmpProject\AmpWP\Admin\Polyfills::class,
'admin.user_rest_endpoint_extension' => \AmpProject\AmpWP\Admin\UserRESTEndpointExtension::class,
'admin.validation_counts' => \AmpProject\AmpWP\Admin\ValidationCounts::class,
'admin.amp_plugins' => \AmpProject\AmpWP\Admin\AmpPlugins::class,
'admin.amp_themes' => \AmpProject\AmpWP\Admin\AmpThemes::class,
'amp_slug_customization_watcher' => \AmpProject\AmpWP\AmpSlugCustomizationWatcher::class,
'background_task_deactivator' => \AmpProject\AmpWP\BackgroundTask\BackgroundTaskDeactivator::class,
'block_uniqid_transformer' => \AmpProject\AmpWP\BlockUniqidTransformer::class,
'cli.command_namespace' => \AmpProject\AmpWP\CliCli\CommandNamespaceRegistration::class,
'cli.optimizer_command' => \AmpProject\AmpWP\CliCli\OptimizerCommand::class,
'cli.transformer_command' => \AmpProject\AmpWP\CliCli\TransformerCommand::class,
'cli.validation_command' => \AmpProject\AmpWP\CliCli\ValidationCommand::class,
'cli.command_namespace' => \AmpProject\AmpWP\Cli\CommandNamespaceRegistration::class,
'cli.optimizer_command' => \AmpProject\AmpWP\Cli\OptimizerCommand::class,
'cli.transformer_command' => \AmpProject\AmpWP\Cli\TransformerCommand::class,
'cli.validation_command' => \AmpProject\AmpWP\Cli\ValidationCommand::class,
'cli.option_command' => \AmpProject\AmpWP\Cli\OptionCommand::class,
'css_transient_cache.ajax_handler' => \AmpProject\AmpWP\Admin\ReenableCssTransientCachingAjaxAction::class,
'css_transient_cache.monitor' => \AmpProject\AmpWP\BackgroundTask\MonitorCssTransientCaching::class,
'dependency_support' => \AmpProject\AmpWP\DependencySupport::class,
Expand Down Expand Up @@ -62,7 +65,7 @@
'url_validation_cron' => \AmpProject\AmpWP\Validation\URLValidationCron::class,
'url_validation_rest_controller' => \AmpProject\AmpWP\Validation\URLValidationRESTController::class,
'validated_url_stylesheet_gc' => \AmpProject\AmpWP\BackgroundTask\ValidatedUrlStylesheetDataGarbageCollection::class,
'validation_data_gc' => \AmpProject\AmpWP\BackgroundTask\ValidationDataGarbageCollection::class,
'validated_data_gc' => \AmpProject\AmpWP\BackgroundTask\ValidationDataGarbageCollection::class,
'validation.scannable_url_provider' => \AmpProject\AmpWP\Validation\ScannableURLProvider::class,
'validation.url_validation_provider' => \AmpProject\AmpWP\Validation\URLValidationProvider::class,
] )
Expand Down
4 changes: 0 additions & 4 deletions bin/local-env/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ services:
- wordpress_data:/var/www/html
- ../../:/var/www/html/wp-content/plugins/amp
- ./uploads.ini:/usr/local/etc/php/conf.d/uploads.ini
# @TODO: Remove it once Gutenberg 16.3 is released.
- /tmp/gutenberg/:/var/www/html/wp-content/plugins/gutenberg
depends_on:
- mysql

Expand All @@ -22,8 +20,6 @@ services:
volumes:
- wordpress_data:/var/www/html
- ../../:/var/www/html/wp-content/plugins/amp
# @TODO: Remove it once Gutenberg 16.3 is released.
- /tmp/gutenberg/:/var/www/html/wp-content/plugins/gutenberg
env_file:
- .env.wp
depends_on:
Expand Down
24 changes: 12 additions & 12 deletions bin/local-env/install-wordpress.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,25 +108,25 @@ wp plugin activate amp --quiet

# Install & activate Gutenberg plugin.
echo -e $(status_message "Installing and activating Gutenberg plugin...")

# @TODO: Remove it once Gutnberg 16.3 is released.
# wp plugin install gutenberg --activate --force --quiet
wp plugin activate gutenberg --quiet
wp plugin install gutenberg --activate --force --quiet

# Set pretty permalinks.
echo -e $(status_message "Setting permalink structure...")
wp rewrite structure '%postname%' --hard --quiet

# Configure site constants.
echo -e $(status_message "Configuring site constants...")

# @TODO: Remove this once WP 6.3 is released.
wp config delete WP_DEBUG

# Log WP_DEBUG value.
WP_DEBUG_CURRENT=$(wp config get --type=constant --format=json WP_DEBUG | tr -d '\r')
echo -e $(status_message "WP_DEBUG: $WP_DEBUG_CURRENT...")

# Log SCRIPT_DEBUG value.
if [ "$WP_DEBUG" != $WP_DEBUG_CURRENT ]; then
wp config set WP_DEBUG $WP_DEBUG --raw --type=constant --quiet
WP_DEBUG_RESULT=$(wp config get --type=constant --format=json WP_DEBUG | tr -d '\r')
echo -e $(status_message "WP_DEBUG: $WP_DEBUG_RESULT...")
fi

SCRIPT_DEBUG_CURRENT=$(wp config get --type=constant --format=json SCRIPT_DEBUG | tr -d '\r')
echo -e $(status_message "SCRIPT_DEBUG: $SCRIPT_DEBUG_CURRENT...")
if [ "$SCRIPT_DEBUG" != $SCRIPT_DEBUG_CURRENT ]; then
wp config set SCRIPT_DEBUG $SCRIPT_DEBUG --raw --type=constant --quiet
SCRIPT_DEBUG_RESULT=$(wp config get --type=constant --format=json SCRIPT_DEBUG | tr -d '\r')
echo -e $(status_message "SCRIPT_DEBUG: $SCRIPT_DEBUG_RESULT...")
fi
5 changes: 0 additions & 5 deletions bin/local-env/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ cd "$(dirname "$0")/../.."
# Check whether Composer installed
. "$(dirname "$0")/install-composer.sh"

# @TODO: Remove it once Gutnberg 16.3 is released.
rm -rf /tmp/gutenberg /tmp/gutenberg.zip
wget https://amp-wp.org/wp-content/uploads/2023/07/gutenberg.zip -O /tmp/gutenberg.zip
unzip /tmp/gutenberg.zip -d /tmp/gutenberg

# Check whether Docker is installed and running
. "$(dirname "$0")/launch-containers.sh"

Expand Down
Loading

0 comments on commit f5304e2

Please sign in to comment.