Skip to content
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
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ test-rust-doc:
test-server: stop-server
rm -rf test_credentials && touch test_credentials && chmod 777 test_credentials
docker-compose up -d
docker-compose run wpcli
docker exec -i wordpress /bin/bash < ./scripts/setup-test-site.sh

stop-server: delete-wp-plugins-backup
docker-compose down
Expand Down Expand Up @@ -235,6 +235,9 @@ dev-server:
mkdir -p .wordpress
docker-compose up

prepare-dev-server:
docker exec -i wordpress /bin/bash < ./scripts/setup-test-site.sh

setup-rust:
RUST_TOOLCHAIN=stable $(MAKE) setup-rust-toolchain
RUST_TOOLCHAIN=$(rust_nightly_toolchain) $(MAKE) setup-rust-toolchain
Expand Down
22 changes: 1 addition & 21 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ services:
- '80:80'
volumes:
- .wordpress:/var/www/html
- ./test_credentials:/tmp/test_credentials
environment:
WORDPRESS_DB_HOST: mysql
WORDPRESS_DB_USER: wordpress
Expand All @@ -25,27 +26,6 @@ services:
timeout: 1s
retries: 30

wpcli:
image: 'public.ecr.aws/docker/library/wordpress:cli'
user: 33:33 # Fixes permissions issues with writing files
volumes:
- ./.buildkite/setup-test-site.sh:/setup-test-site.sh:ro
- ./.wordpress/wp-config.php:/var/www/html/wp-config.php:ro
- ./test_credentials:/tmp/test_credentials
environment:
WORDPRESS_DB_HOST: mysql
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: wordpress
WORDPRESS_DB_NAME: wordpress
depends_on:
mysql:
condition: service_healthy
wordpress:
condition: service_healthy
entrypoint: ["/setup-test-site.sh"]
profiles:
- donotstart

mysql:
image: 'public.ecr.aws/docker/library/mysql:8.0'
ports:
Expand Down
9 changes: 9 additions & 0 deletions .buildkite/setup-test-site.sh → scripts/setup-test-site.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ set -e
# for each WordPress version – if there are issues with DB migrations, different default themes
# available, etc we don't want to have to deal with them.

curl https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar --output /usr/bin/wp
chmod +x /usr/bin/wp

# Run all the commands below as `www-data` (because that's what WordPress uses itself, so there shouldn't
# be any weird permissions issues)
su -s /bin/bash www-data

## Install WordPress
wp core download --force

Expand All @@ -32,8 +39,10 @@ wp plugin install wordpress-importer --activate
wp import /tmp/testdata.xml --authors=create

## Then clean up the importer plugin
wp plugin deactivate wordpress-importer
wp plugin delete wordpress-importer


{
printf "http://localhost\ntest@example.com\n"
## Create an Application password for the admin user, and store it where it can be used by the test suite
Expand Down