From ee5da6ccd91d7962ff4ffc7e2f7d7abdce20adc9 Mon Sep 17 00:00:00 2001 From: Steve Grunwell Date: Fri, 29 Nov 2019 12:38:08 -0500 Subject: [PATCH 1/2] Lay out some basic concepts around the Docker Container --- docs/Docker-Container.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 docs/Docker-Container.md diff --git a/docs/Docker-Container.md b/docs/Docker-Container.md new file mode 100644 index 0000000..94f8653 --- /dev/null +++ b/docs/Docker-Container.md @@ -0,0 +1,37 @@ +# Docker Container + +## Concept + +A Docker Container (or Docker Compose configuration) designed to test WordPress themes and plugins, especially under different combinations and/or configurations. + +### Examples + +This might be used to test a single WordPress plugin across multiple versions of WordPress + PHP: + +```yaml +env: + - PHP_VERSION=7.4 WP_VERSION=5.3 + - PHP_VERSION=7.0 WP_VERSION=4.9 +``` + +It may also be used to test certain combinations of plugins: + +```yaml +env: + - WP_PLUGINS=jetpack@latest,woocommerce@3.7 +``` + +## Implementation + +[WordPress 5.3 introduced the WordPress Local Environment](https://make.wordpress.org/core/2019/08/05/wordpress-local-environment/), [a series of semi-official Docker containers](https://hub.docker.com/u/wordpressdevelop) made to test WordPress core across different versions of PHP. + +We can extend these containers (which use Docker Compose) to build environments that, for example, pre-load test data, install + activate plugins, and more. + +Better yet, we can make it possible for developers to run specific combinations locally rather than relying that everything go through docker. + +Ideally, this would be handled through a script that will set up the necessary environment, along the lines of: + +```sh +$ setup-wp-environment --php=7.3 --wp=trunk --plugin=jetpack --plugin=caldera-forms +$ phpunit +``` From e7da3755a17717666ffaf1e910e81243fcdb07d0 Mon Sep 17 00:00:00 2001 From: Steve Grunwell Date: Fri, 29 Nov 2019 12:45:28 -0500 Subject: [PATCH 2/2] Add links to work that Josh and I have done --- docs/Docker-Container.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/Docker-Container.md b/docs/Docker-Container.md index 94f8653..8096701 100644 --- a/docs/Docker-Container.md +++ b/docs/Docker-Container.md @@ -35,3 +35,8 @@ Ideally, this would be handled through a script that will set up the necessary e $ setup-wp-environment --php=7.3 --wp=trunk --plugin=jetpack --plugin=caldera-forms $ phpunit ``` + +## Resources + +* https://git.saturdaydrive.io/_/engineering-ops/boilerplate/wordpress-plugin +* https://github.com/assertwell/wp-docker-container