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

WIP: Lay out some basic concepts around the Docker Container #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
42 changes: 42 additions & 0 deletions docs/Docker-Container.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# 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,[email protected]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense. It should also allow installing via zip. For example caldera-forms@https://github.com/CalderaWP/Caldera-Forms/releases/download/1.8.3-beta.1/1.8.3-beta.1.zip or [email protected].

wp-cli can install plugin by WordPress.org slug or ZIP file https://developer.wordpress.org/cli/commands/plugin/install/

```

## 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
```

## Resources

* https://git.saturdaydrive.io/_/engineering-ops/boilerplate/wordpress-plugin
* https://github.com/assertwell/wp-docker-container