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

Switch to using the Core local environment #17004

Merged
merged 91 commits into from
Aug 30, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
8a67776
First pass at use core local env.
pento Aug 12, 2019
ef8e1c3
Delete all the files this setup will replace. (Many of them are not y…
pento Aug 13, 2019
95b671d
Retrieve the compose file version from Core's docker-compose.yml, to …
pento Aug 13, 2019
37ed924
Change NPM scripts to use the Core Docker environment.
pento Aug 13, 2019
94be79d
Use local-env in Travis.
pento Aug 13, 2019
0498428
Run composer locally, instead of in Docker.
pento Aug 13, 2019
a39012e
Run `npm install` for WordPress in Travis.
pento Aug 13, 2019
5a9e154
Upgrade Docker on Travis
pento Aug 13, 2019
5242cd8
Use the right build script name.
pento Aug 13, 2019
1cdd12a
Travis needs to `npm ci` for all jobs now.
pento Aug 13, 2019
32070c1
push !== append
pento Aug 13, 2019
edb7b6a
Run `composer install` in the PHP Unit Test jobs.
pento Aug 13, 2019
94e456d
Add debugging
pento Aug 13, 2019
1342f4d
Change the COMPOSER env var to COMPOSER_INSTALL. The former is used b…
pento Aug 13, 2019
c3c2d7c
Build Gutenberg before running it.
pento Aug 13, 2019
a679ae9
Fix the PHPUnit multisite test command.
pento Aug 13, 2019
bd92a8d
Activate the Gutenberg plugin after installing it.
pento Aug 13, 2019
020f721
Run e2e tests against the build dir.
pento Aug 13, 2019
cfd0933
Build to the build dir
pento Aug 13, 2019
88bb0b8
Gutenberg is in the build directory on Travis.
pento Aug 14, 2019
96af4a1
Travis debugging.
pento Aug 14, 2019
dbfe7ad
Run PHP unit tests in the build dir.
pento Aug 14, 2019
4cbd978
Configure WordPress to load from the build directory.
pento Aug 14, 2019
c99524c
Run author e2e tests as an author.
pento Aug 14, 2019
d372e1f
Fix the command for setting up the author user.
pento Aug 14, 2019
c8dd498
Travis: create the uploads directory.
pento Aug 14, 2019
f8f6460
Travis: Don't need to disable SCRIPT_DEBUG for e2e tests.
pento Aug 14, 2019
f10a38a
Move the env scripts to wp-scripts.
pento Aug 14, 2019
02ca863
Add a bunch of env helper scripts.
pento Aug 15, 2019
92c0117
Travis: Composer tasks need WP installed, now.
pento Aug 15, 2019
370ef52
Fix the mount directory in the PHPUnit container.
pento Aug 15, 2019
273c761
Don't lint CSS in the WordPress directory.
pento Aug 15, 2019
9e48716
Disable SCRIPT_DEBUG, and clean up the globals.
pento Aug 15, 2019
1e948c9
Generate docker-compose.override.yml from a template file.
pento Aug 15, 2019
8b0c239
Add start/stop scripts.
pento Aug 16, 2019
fcc1467
Add an install script.
pento Aug 16, 2019
519de4d
Tidy up .travis.yml
pento Aug 16, 2019
baf81fb
Travis: WordPress install now needs to happen after npm ci.
pento Aug 16, 2019
8227869
Allow other plugins using these scripts to override the docker-compos…
pento Aug 19, 2019
83b0aa7
Try activating the plugin using the core WP-CLI script.
pento Aug 19, 2019
ece0f01
Run the correct core build command.
pento Aug 19, 2019
843f622
b0d7330cf773d06a292a56ab9cb27793a7874c39 is obseleted by #16243.
pento Aug 20, 2019
ecc8b25
Check if WordPress is already installed before trying to install it a…
pento Aug 21, 2019
028460a
If we're running in a managed environment, encourage updating if it h…
pento Aug 21, 2019
52059be
Check the Node version before trying to do any environment work.
pento Aug 22, 2019
9e6054b
Add a placeholder for setup-local-env.sh, pointing folks at the new w…
pento Aug 22, 2019
07be5aa
Update the documentation for the local-env.
pento Aug 22, 2019
78bdc3b
Add inline commenting for mergeConfigs().
pento Aug 22, 2019
548b10a
Ensure we catch invalid YAML template files.
pento Aug 22, 2019
2b020f4
Improve behaviour on Windows.
pento Aug 22, 2019
ebaffd8
Simplify the array merging, so old items aren't left hanging around.
pento Aug 22, 2019
8248c80
Add an extra prompt to help people who run env commands without a WP_…
pento Aug 22, 2019
69a91df
List the commands when no arguments are passed to npm run env.
pento Aug 22, 2019
6fd7805
Auto switch between running PHPUnit tests from the src or build direc…
pento Aug 22, 2019
6d628a2
Fix PHPUnit tests not properly running in the build directory.
pento Aug 23, 2019
837e6d1
Let's keep the welcome message when installing local-env.
pento Aug 23, 2019
56e2009
Normalise WP_DEVELOP_DIR when it's generated, so we don't need to nor…
pento Aug 26, 2019
e97900c
Fix an incorrect comment referring to PHPUnit instead of WP-CLI.
pento Aug 26, 2019
15db588
Expand abbreviated variable names.
pento Aug 26, 2019
f963793
Remove an unnecessary normalize()
pento Aug 26, 2019
4859699
Use Array.isArray() to test for arrays.
pento Aug 26, 2019
e8bc7f3
Use isPlainObject() to test for objects.
pento Aug 26, 2019
a6d2e73
Make require look a little more like import.
pento Aug 26, 2019
a52430d
Make require look a little more like import.
pento Aug 26, 2019
92def6a
Make require look a little more like import.
pento Aug 26, 2019
18183ea
Remove a bonus \n
pento Aug 26, 2019
0e1596f
Travis: Rename some environment variables, to make their meaning a li…
pento Aug 26, 2019
602bbb7
Refactor repetitive code into util functions.
pento Aug 26, 2019
ef7d0b7
s/mergeYamlConfigs/mergeYAMLConfigs/g
pento Aug 26, 2019
13c1f90
Reset the database before running e2e tests.
pento Aug 27, 2019
bd90182
Try using Travis build stages to cache the slow parts.
pento Aug 27, 2019
12c52bb
Tweak the Travis caching.
pento Aug 27, 2019
50748b9
Try to share the cache between builds.
pento Aug 27, 2019
8b356eb
Speed up the cache warmup
pento Aug 27, 2019
0903b9c
Don't clone the repo if it's already cached.
pento Aug 27, 2019
e64edb8
Set the PHP version for PHP 5.6 tests.
pento Aug 27, 2019
a6cf935
Fix a .travis.yml parse error.
pento Aug 27, 2019
62e035c
Give MySQL some time to start.
pento Aug 27, 2019
472ca38
No need to cache wordpress/node_modules.
pento Aug 27, 2019
4cdf186
More Travis tweaking.
pento Aug 27, 2019
1b2cba5
Try not caching node_modules
pento Aug 27, 2019
4957667
Try manually downloading the built version of WordPress.
pento Aug 28, 2019
8159801
Fix up some Travis bugs.
pento Aug 28, 2019
1c582ce
Add some debugging.
pento Aug 28, 2019
f8e5524
Travis: HALP HOW DO I mv
pento Aug 28, 2019
84035b1
A little more tweaking.
pento Aug 28, 2019
f36fb00
Copy the tests directory from WP, too.
pento Aug 28, 2019
a09be70
Improve performance of lint and license tests.
pento Aug 28, 2019
a47f54c
Add documentation to README.md.
pento Aug 28, 2019
bc69eda
Travis: Cache the cacheable bits of Composer.
pento Aug 28, 2019
ab6f7e0
Update the @wordpress/scripts changelog.
pento Aug 29, 2019
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
Prev Previous commit
Next Next commit
Improve behaviour on Windows.
  • Loading branch information
pento committed Aug 29, 2019
commit 2b020f497547805e4390dabb5f85d65a50b657f7
6 changes: 4 additions & 2 deletions packages/scripts/scripts/env/connect.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,12 @@ function mergeConfigs( originalConfig, newConfig ) {
// /path/to/local/dir:/path/to/container/dir:config:stuff
newConfig[ key ].forEach( ( element ) => {
// First, check if it's actually a volume config.
if ( element.startsWith( pluginMountDir ) && element.includes( ':' ) ) {
// Ignore the first few characters, so that we skip over Windows drive letters.
const colonPos = element.indexOf( ':', 3 );
if ( colonPos > -1 && element.startsWith( pluginMountDir ) ) {
// Get the local directory that's being mounted. This can either be the plugin
// base directory, or a subdirectory of it.
const mountDir = element.split( ':' )[ 0 ];
const mountDir = element.substring( 0, colonPos );
// See if this mountDir exists in the originalConfig.
const index = originalConfig[ key ].findIndex( ( volume ) => {
return volume.startsWith( `${ mountDir }:` );
Expand Down
6 changes: 3 additions & 3 deletions packages/scripts/scripts/env/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ if ( commandExistsSync( 'git' ) ) {
execSync( 'git clone --depth=1 git://develop.git.wordpress.org/ wordpress', { stdio: 'inherit' } );
buildWordPress();
} else {
stdout.write( "Git isn't availabe. Switching to downloading a zip version.\n" );
stdout.write( "Git isn't available. Switching to downloading a zip version.\n" );
const tmpZip = normalize( tmpdir() + '/wordpress-develop.zip' );
const tmpZipWriter = createWriteStream( tmpZip );

Expand All @@ -35,10 +35,10 @@ if ( commandExistsSync( 'git' ) ) {

unzipper.on( 'extract', buildWordPress );

stdout.write( 'Extracing...\n' );
stdout.write( 'Extracting...\n' );

unzipper.extract( {
path: env.WP_DEVELOP_DIR,
path: normalize( env.WP_DEVELOP_DIR ),
strip: 1,
filter: ( file ) => file.type !== 'Directory',
} );
Expand Down
6 changes: 3 additions & 3 deletions packages/scripts/scripts/env/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ if ( commandExistsSync( 'git' ) ) {
execSync( 'git pull', { cwd: normalize( env.WP_DEVELOP_DIR ), stdio: 'inherit' } );
buildWordPress();
} else {
stdout.write( "Git isn't availabe. Switching to downloading a zip version.\n" );
stdout.write( "Git isn't available. Switching to downloading a zip version.\n" );
const tmpZip = normalize( tmpdir() + '/wordpress-develop.zip' );
const tmpZipWriter = createWriteStream( tmpZip );

Expand All @@ -30,10 +30,10 @@ if ( commandExistsSync( 'git' ) ) {

unzipper.on( 'extract', buildWordPress );

stdout.write( 'Extracing...\n' );
stdout.write( 'Extracting...\n' );

unzipper.extract( {
path: env.WP_DEVELOP_DIR,
path: normalize( env.WP_DEVELOP_DIR ),
strip: 1,
filter: ( file ) => file.type !== 'Directory',
} );
Expand Down