-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
1 parent
7c32ac9
commit 81da692
Showing
16 changed files
with
972 additions
and
424 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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"core": "WordPress/WordPress", | ||
"plugins": [ "." ] | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,5 +1,13 @@ | ||
## Master | ||
|
||
### Breaking Changes | ||
|
||
- `wp-env start` no longer accepts a WordPress branch or tag reference as its argument. Instead, create a `.wp-env.json` file and specify a `"core"` field. | ||
|
||
### New Feature | ||
|
||
- A `.wp-env.json` configuration file can now be used to specify the WordPress installation, plugins, and themes to use in the local development environment. | ||
|
||
### Bug Fixes | ||
|
||
- When running scripts using `wp-env run`, the output will not be formatted if not written to terminal display, resolving an issue where piped or redirected output could be unintentionally padded with newlines. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
'use strict'; | ||
/** | ||
* External dependencies | ||
*/ | ||
const fs = require( 'fs' ); | ||
const path = require( 'path' ); | ||
|
||
/** | ||
* Creates a docker-compose config object which, when serialized into a | ||
* docker-compose.yml file, tells docker-compose how to run the environment. | ||
* | ||
* @param {Config} config A wp-env config object. | ||
* @return {Object} A docker-compose config object, ready to serialize into YAML. | ||
*/ | ||
module.exports = function buildDockerComposeConfig( config ) { | ||
const pluginMounts = config.pluginSources.flatMap( ( source ) => [ | ||
`${ source.path }:/var/www/html/wp-content/plugins/${ source.basename }`, | ||
|
||
// If this is is the Gutenberg plugin, then mount its E2E test plugins. | ||
// TODO: Implement an API that lets Gutenberg mount test plugins without this workaround. | ||
...( fs.existsSync( path.resolve( source.path, 'gutenberg.php' ) ) && [ | ||
`${ source.path }/packages/e2e-tests/plugins:/var/www/html/wp-content/plugins/gutenberg-test-plugins`, | ||
`${ source.path }/packages/e2e-tests/mu-plugins:/var/www/html/wp-content/mu-plugins`, | ||
] ), | ||
] ); | ||
|
||
const themeMounts = config.themeSources.map( | ||
( source ) => `${ source.path }:/var/www/html/wp-content/themes/${ source.basename }` | ||
); | ||
|
||
const developmentMounts = [ | ||
`${ config.coreSource ? config.coreSource.path : 'wordpress' }:/var/www/html`, | ||
...pluginMounts, | ||
...themeMounts, | ||
]; | ||
|
||
const testsMounts = [ | ||
`${ config.coreSource ? config.coreSource.testsPath : 'tests-wordpress' }:/var/www/html`, | ||
...pluginMounts, | ||
...themeMounts, | ||
]; | ||
|
||
return { | ||
version: '3.7', | ||
services: { | ||
mysql: { | ||
image: 'mariadb', | ||
environment: { | ||
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes', | ||
}, | ||
}, | ||
wordpress: { | ||
depends_on: [ 'mysql' ], | ||
image: 'wordpress', | ||
ports: [ '${WP_ENV_PORT:-8888}:80' ], | ||
environment: { | ||
WORDPRESS_DEBUG: '1', | ||
}, | ||
volumes: developmentMounts, | ||
}, | ||
'tests-wordpress': { | ||
depends_on: [ 'mysql' ], | ||
image: 'wordpress', | ||
ports: [ '${WP_ENV_TESTS_PORT:-8889}:80' ], | ||
environment: { | ||
WORDPRESS_DEBUG: '1', | ||
}, | ||
volumes: testsMounts, | ||
}, | ||
cli: { | ||
depends_on: [ 'wordpress' ], | ||
image: 'wordpress:cli', | ||
volumes: developmentMounts, | ||
}, | ||
'tests-cli': { | ||
depends_on: [ 'wordpress' ], | ||
image: 'wordpress:cli', | ||
volumes: testsMounts, | ||
}, | ||
composer: { | ||
image: 'composer', | ||
volumes: [ `${ config.configDirectoryPath }:/app` ], | ||
}, | ||
}, | ||
volumes: { | ||
...( ! config.coreSource && { wordpress: {} } ), | ||
...( ! config.coreSource && { 'tests-wordpress': {} } ), | ||
}, | ||
}; | ||
}; |
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.