Make WordPress Core

Ticket #47767: 47767.16.diff

File 47767.16.diff, 36.8 KB (added by pento, 6 years ago)
  • .env

    diff --git a/.env b/.env
    index 63ae0f1962..87d57d42da 100644
    a b LOCAL_WP_DEBUG=true 
    2929LOCAL_WP_DEBUG_LOG=true
    3030LOCAL_WP_DEBUG_DISPLAY=true
    3131LOCAL_SCRIPT_DEBUG=true
     32
     33# The URL to use when running e2e tests.
     34WP_BASE_URL=http://localhost:${LOCAL_PORT}
  • .gitignore

    diff --git a/.gitignore b/.gitignore
    index b475d3fb9d..2f4d4eb9d2 100644
    a b wp-tests-config.php 
    7373*.diff
    7474.svn
    7575!/src/js/_enqueues/vendor
     76
     77# Files for local environment config
     78/docker-compose.override.yml
  • docker-compose.yml

    diff --git a/tools/local-env/docker-compose.yml b/docker-compose.yml
    similarity index 51%
    rename from tools/local-env/docker-compose.yml
    rename to docker-compose.yml
    index ddbec7fe47..6fc52fc4ab 100644
    old new services: 
    1818      LOCAL_DIR: ${LOCAL_DIR-src}
    1919
    2020    volumes:
    21       - ./default.template:/etc/nginx/conf.d/default.template
    22       - ../../:/var/www
     21      - ./tools/local-env/default.template:/etc/nginx/conf.d/default.template
     22      - ./:/var/www
    2323
    2424    # Load our config file, substituning environment variables into the config.
    2525    command: /bin/sh -c "envsubst '$$LOCAL_DIR' < /etc/nginx/conf.d/default.template > /etc/nginx/conf.d/default.conf && exec nginx -g 'daemon off;'"
    services: 
    4141      LOCAL_PHP_MEMCACHED: ${LOCAL_PHP_MEMCACHED-false}
    4242
    4343    volumes:
    44       - ./php-config.ini:/usr/local/etc/php/conf.d/php-config.ini
    45       - ../../:/var/www
     44      - ./tools/local-env/php-config.ini:/usr/local/etc/php/conf.d/php-config.ini
     45      - ./:/var/www
    4646
    4747    depends_on:
    4848      - mysql
    services: 
    6060      MYSQL_ROOT_PASSWORD: password
    6161
    6262    volumes:
    63       - ./mysql-init.sql:/docker-entrypoint-initdb.d/mysql-init.sql
     63      - ./tools/local-env/mysql-init.sql:/docker-entrypoint-initdb.d/mysql-init.sql
    6464      - mysql:/var/lib/mysql
    6565
    6666    # For compatibility with PHP versions that don't support the caching_sha2_password auth plugin used in MySQL 8.0.
    6767    command: --default-authentication-plugin=mysql_native_password
    6868
     69  ##
     70  # The WP CLI container.
     71  ##
     72  cli:
     73    image: wordpressdevelop/cli:${LOCAL_PHP-latest}
     74
     75    networks:
     76      - wpdevnet
     77
     78    environment:
     79      LOCAL_PHP_XDEBUG: ${LOCAL_PHP_XDEBUG-false}
     80      LOCAL_PHP_MEMCACHED: ${LOCAL_PHP_MEMCACHED-false}
     81
     82    volumes:
     83      - ./:/var/www
     84
     85    # The init directive ensures the command runs with a PID > 1, so Ctrl+C works correctly.
     86    init: true
     87
     88  ##
     89  # The PHPUnit container.
     90  ##
     91  phpunit:
     92    image: wordpressdevelop/phpunit:${LOCAL_PHP-latest}
     93
     94    networks:
     95      - wpdevnet
     96
     97    environment:
     98      LOCAL_PHP_XDEBUG: ${LOCAL_PHP_XDEBUG-false}
     99      LOCAL_PHP_MEMCACHED: ${LOCAL_PHP_MEMCACHED-false}
     100
     101    volumes:
     102      - ./tools/local-env/phpunit-config.ini:/usr/local/etc/php/conf.d/phpunit-config.ini
     103      - ./:/wordpress-develop
     104      - phpunit-uploads:/wordpress-develop/${LOCAL_DIR-src}/wp-content/uploads
     105
     106    # The init directive ensures the command runs with a PID > 1, so Ctrl+C works correctly.
     107    init: true
     108
     109    depends_on:
     110      - mysql
     111
    69112volumes:
    70113  # So that sites aren't wiped every time containers are restarted, MySQL uses a persistent volume.
    71114  mysql: {}
     115  # Using a volume for the uploads directory improves PHPUnit performance.
     116  phpunit-uploads: {}
    72117
    73118networks:
    74119  # Creating our own network allows us to connect between containers using their service name.
  • package-lock.json

    diff --git a/package-lock.json b/package-lock.json
    index c7496132c4..13e5201343 100644
    a b  
    37193719                                "trim-right": "^1.0.1"
    37203720                        }
    37213721                },
    3722                 "babel-helper-bindify-decorators": {
    3723                         "version": "6.24.1",
    3724                         "resolved": "https://registry.npmjs.org/babel-helper-bindify-decorators/-/babel-helper-bindify-decorators-6.24.1.tgz",
    3725                         "integrity": "sha1-FMGeXxQte0fxmlJDHlKxzLxAozA=",
    3726                         "dev": true,
    3727                         "requires": {
    3728                                 "babel-runtime": "^6.22.0",
    3729                                 "babel-traverse": "^6.24.1",
    3730                                 "babel-types": "^6.24.1"
    3731                         }
    3732                 },
    3733                 "babel-helper-builder-binary-assignment-operator-visitor": {
    3734                         "version": "6.24.1",
    3735                         "resolved": "https://registry.npmjs.org/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz",
    3736                         "integrity": "sha1-zORReto1b0IgvK6KAsKzRvmlZmQ=",
    3737                         "dev": true,
    3738                         "requires": {
    3739                                 "babel-helper-explode-assignable-expression": "^6.24.1",
    3740                                 "babel-runtime": "^6.22.0",
    3741                                 "babel-types": "^6.24.1"
    3742                         }
    3743                 },
    37443722                "babel-helper-call-delegate": {
    37453723                        "version": "6.24.1",
    37463724                        "resolved": "https://registry.npmjs.org/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz",
     
    37633741                                "lodash": "^4.17.4"
    37643742                        }
    37653743                },
    3766                 "babel-helper-explode-assignable-expression": {
    3767                         "version": "6.24.1",
    3768                         "resolved": "https://registry.npmjs.org/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz",
    3769                         "integrity": "sha1-8luCz33BBDPFX3BZLVdGQArCLKo=",
    3770                         "dev": true,
    3771                         "requires": {
    3772                                 "babel-runtime": "^6.22.0",
    3773                                 "babel-traverse": "^6.24.1",
    3774                                 "babel-types": "^6.24.1"
    3775                         }
    3776                 },
    3777                 "babel-helper-explode-class": {
    3778                         "version": "6.24.1",
    3779                         "resolved": "https://registry.npmjs.org/babel-helper-explode-class/-/babel-helper-explode-class-6.24.1.tgz",
    3780                         "integrity": "sha1-fcKjkQ3uAHBW4eMdZAztPVTqqes=",
    3781                         "dev": true,
    3782                         "requires": {
    3783                                 "babel-helper-bindify-decorators": "^6.24.1",
    3784                                 "babel-runtime": "^6.22.0",
    3785                                 "babel-traverse": "^6.24.1",
    3786                                 "babel-types": "^6.24.1"
    3787                         }
    3788                 },
    37893744                "babel-helper-function-name": {
    37903745                        "version": "6.24.1",
    37913746                        "resolved": "https://registry.npmjs.org/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz",
     
    38353790                                "lodash": "^4.17.4"
    38363791                        }
    38373792                },
    3838                 "babel-helper-remap-async-to-generator": {
    3839                         "version": "6.24.1",
    3840                         "resolved": "https://registry.npmjs.org/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz",
    3841                         "integrity": "sha1-XsWBgnrXI/7N04HxySg5BnbkVRs=",
    3842                         "dev": true,
    3843                         "requires": {
    3844                                 "babel-helper-function-name": "^6.24.1",
    3845                                 "babel-runtime": "^6.22.0",
    3846                                 "babel-template": "^6.24.1",
    3847                                 "babel-traverse": "^6.24.1",
    3848                                 "babel-types": "^6.24.1"
    3849                         }
    3850                 },
    38513793                "babel-helper-replace-supers": {
    38523794                        "version": "6.24.1",
    38533795                        "resolved": "https://registry.npmjs.org/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz",
     
    40153957                                "@types/babel__traverse": "^7.0.6"
    40163958                        }
    40173959                },
    4018                 "babel-plugin-syntax-async-functions": {
    4019                         "version": "6.13.0",
    4020                         "resolved": "https://registry.npmjs.org/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz",
    4021                         "integrity": "sha1-ytnK0RkbWtY0vzCuCHI5HgZHvpU=",
    4022                         "dev": true
    4023                 },
    4024                 "babel-plugin-syntax-async-generators": {
    4025                         "version": "6.13.0",
    4026                         "resolved": "https://registry.npmjs.org/babel-plugin-syntax-async-generators/-/babel-plugin-syntax-async-generators-6.13.0.tgz",
    4027                         "integrity": "sha1-a8lj67FuzLrmuStZbrfzXDQqi5o=",
    4028                         "dev": true
    4029                 },
    4030                 "babel-plugin-syntax-class-constructor-call": {
    4031                         "version": "6.18.0",
    4032                         "resolved": "https://registry.npmjs.org/babel-plugin-syntax-class-constructor-call/-/babel-plugin-syntax-class-constructor-call-6.18.0.tgz",
    4033                         "integrity": "sha1-nLnTn+Q8hgC+yBRkVt3L1OGnZBY=",
    4034                         "dev": true
    4035                 },
    4036                 "babel-plugin-syntax-class-properties": {
    4037                         "version": "6.13.0",
    4038                         "resolved": "https://registry.npmjs.org/babel-plugin-syntax-class-properties/-/babel-plugin-syntax-class-properties-6.13.0.tgz",
    4039                         "integrity": "sha1-1+sjt5oxf4VDlixQW4J8fWysJ94=",
    4040                         "dev": true
    4041                 },
    4042                 "babel-plugin-syntax-decorators": {
    4043                         "version": "6.13.0",
    4044                         "resolved": "https://registry.npmjs.org/babel-plugin-syntax-decorators/-/babel-plugin-syntax-decorators-6.13.0.tgz",
    4045                         "integrity": "sha1-MSVjtNvePMgGzuPkFszurd0RrAs=",
    4046                         "dev": true
    4047                 },
    4048                 "babel-plugin-syntax-do-expressions": {
    4049                         "version": "6.13.0",
    4050                         "resolved": "https://registry.npmjs.org/babel-plugin-syntax-do-expressions/-/babel-plugin-syntax-do-expressions-6.13.0.tgz",
    4051                         "integrity": "sha1-V0d1YTmqJtOQ0JQQsDdEugfkeW0=",
    4052                         "dev": true
    4053                 },
    4054                 "babel-plugin-syntax-dynamic-import": {
    4055                         "version": "6.18.0",
    4056                         "resolved": "https://registry.npmjs.org/babel-plugin-syntax-dynamic-import/-/babel-plugin-syntax-dynamic-import-6.18.0.tgz",
    4057                         "integrity": "sha1-jWomIpyDdFqZgqRBBRVyyqF5sdo=",
    4058                         "dev": true
    4059                 },
    4060                 "babel-plugin-syntax-exponentiation-operator": {
    4061                         "version": "6.13.0",
    4062                         "resolved": "https://registry.npmjs.org/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz",
    4063                         "integrity": "sha1-nufoM3KQ2pUoggGmpX9BcDF4MN4=",
    4064                         "dev": true
    4065                 },
    4066                 "babel-plugin-syntax-export-extensions": {
    4067                         "version": "6.13.0",
    4068                         "resolved": "https://registry.npmjs.org/babel-plugin-syntax-export-extensions/-/babel-plugin-syntax-export-extensions-6.13.0.tgz",
    4069                         "integrity": "sha1-cKFITw+QiaToStRLrDU8lbmxJyE=",
    4070                         "dev": true
    4071                 },
    4072                 "babel-plugin-syntax-function-bind": {
    4073                         "version": "6.13.0",
    4074                         "resolved": "https://registry.npmjs.org/babel-plugin-syntax-function-bind/-/babel-plugin-syntax-function-bind-6.13.0.tgz",
    4075                         "integrity": "sha1-SMSV8Xe98xqYHnMvVa3AvdJgH0Y=",
    4076                         "dev": true
    4077                 },
    4078                 "babel-plugin-syntax-object-rest-spread": {
    4079                         "version": "6.13.0",
    4080                         "resolved": "https://registry.npmjs.org/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz",
    4081                         "integrity": "sha1-/WU28rzhODb/o6VFjEkDpZe7O/U=",
    4082                         "dev": true
    4083                 },
    4084                 "babel-plugin-syntax-trailing-function-commas": {
    4085                         "version": "6.22.0",
    4086                         "resolved": "https://registry.npmjs.org/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz",
    4087                         "integrity": "sha1-ugNgk3+NBuQBgKQ/4NVhb/9TLPM=",
    4088                         "dev": true
    4089                 },
    4090                 "babel-plugin-transform-async-generator-functions": {
    4091                         "version": "6.24.1",
    4092                         "resolved": "https://registry.npmjs.org/babel-plugin-transform-async-generator-functions/-/babel-plugin-transform-async-generator-functions-6.24.1.tgz",
    4093                         "integrity": "sha1-8FiQAUX9PpkHpt3yjaWfIVJYpds=",
    4094                         "dev": true,
    4095                         "requires": {
    4096                                 "babel-helper-remap-async-to-generator": "^6.24.1",
    4097                                 "babel-plugin-syntax-async-generators": "^6.5.0",
    4098                                 "babel-runtime": "^6.22.0"
    4099                         }
    4100                 },
    4101                 "babel-plugin-transform-async-to-generator": {
    4102                         "version": "6.24.1",
    4103                         "resolved": "https://registry.npmjs.org/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz",
    4104                         "integrity": "sha1-ZTbjeK/2yx1VF6wOQOs+n8jQh2E=",
    4105                         "dev": true,
    4106                         "requires": {
    4107                                 "babel-helper-remap-async-to-generator": "^6.24.1",
    4108                                 "babel-plugin-syntax-async-functions": "^6.8.0",
    4109                                 "babel-runtime": "^6.22.0"
    4110                         }
    4111                 },
    4112                 "babel-plugin-transform-class-constructor-call": {
    4113                         "version": "6.24.1",
    4114                         "resolved": "https://registry.npmjs.org/babel-plugin-transform-class-constructor-call/-/babel-plugin-transform-class-constructor-call-6.24.1.tgz",
    4115                         "integrity": "sha1-gNwoVQWsBn3LjWxl4vbxGrd2Xvk=",
    4116                         "dev": true,
    4117                         "requires": {
    4118                                 "babel-plugin-syntax-class-constructor-call": "^6.18.0",
    4119                                 "babel-runtime": "^6.22.0",
    4120                                 "babel-template": "^6.24.1"
    4121                         }
    4122                 },
    4123                 "babel-plugin-transform-class-properties": {
    4124                         "version": "6.24.1",
    4125                         "resolved": "https://registry.npmjs.org/babel-plugin-transform-class-properties/-/babel-plugin-transform-class-properties-6.24.1.tgz",
    4126                         "integrity": "sha1-anl2PqYdM9NvN7YRqp3vgagbRqw=",
    4127                         "dev": true,
    4128                         "requires": {
    4129                                 "babel-helper-function-name": "^6.24.1",
    4130                                 "babel-plugin-syntax-class-properties": "^6.8.0",
    4131                                 "babel-runtime": "^6.22.0",
    4132                                 "babel-template": "^6.24.1"
    4133                         }
    4134                 },
    4135                 "babel-plugin-transform-decorators": {
    4136                         "version": "6.24.1",
    4137                         "resolved": "https://registry.npmjs.org/babel-plugin-transform-decorators/-/babel-plugin-transform-decorators-6.24.1.tgz",
    4138                         "integrity": "sha1-eIAT2PjGtSIr33s0Q5Df13Vp4k0=",
    4139                         "dev": true,
    4140                         "requires": {
    4141                                 "babel-helper-explode-class": "^6.24.1",
    4142                                 "babel-plugin-syntax-decorators": "^6.13.0",
    4143                                 "babel-runtime": "^6.22.0",
    4144                                 "babel-template": "^6.24.1",
    4145                                 "babel-types": "^6.24.1"
    4146                         }
    4147                 },
    4148                 "babel-plugin-transform-do-expressions": {
    4149                         "version": "6.22.0",
    4150                         "resolved": "https://registry.npmjs.org/babel-plugin-transform-do-expressions/-/babel-plugin-transform-do-expressions-6.22.0.tgz",
    4151                         "integrity": "sha1-KMyvkoEtlJws0SgfaQyP3EaK6bs=",
    4152                         "dev": true,
    4153                         "requires": {
    4154                                 "babel-plugin-syntax-do-expressions": "^6.8.0",
    4155                                 "babel-runtime": "^6.22.0"
    4156                         }
    4157                 },
    41583960                "babel-plugin-transform-es2015-arrow-functions": {
    41593961                        "version": "6.22.0",
    41603962                        "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz",
     
    43674169                                "regexpu-core": "^2.0.0"
    43684170                        }
    43694171                },
    4370                 "babel-plugin-transform-exponentiation-operator": {
    4371                         "version": "6.24.1",
    4372                         "resolved": "https://registry.npmjs.org/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz",
    4373                         "integrity": "sha1-KrDJx/MJj6SJB3cruBP+QejeOg4=",
    4374                         "dev": true,
    4375                         "requires": {
    4376                                 "babel-helper-builder-binary-assignment-operator-visitor": "^6.24.1",
    4377                                 "babel-plugin-syntax-exponentiation-operator": "^6.8.0",
    4378                                 "babel-runtime": "^6.22.0"
    4379                         }
    4380                 },
    4381                 "babel-plugin-transform-export-extensions": {
    4382                         "version": "6.22.0",
    4383                         "resolved": "https://registry.npmjs.org/babel-plugin-transform-export-extensions/-/babel-plugin-transform-export-extensions-6.22.0.tgz",
    4384                         "integrity": "sha1-U3OLR+deghhYnuqUbLvTkQm75lM=",
    4385                         "dev": true,
    4386                         "requires": {
    4387                                 "babel-plugin-syntax-export-extensions": "^6.8.0",
    4388                                 "babel-runtime": "^6.22.0"
    4389                         }
    4390                 },
    4391                 "babel-plugin-transform-function-bind": {
    4392                         "version": "6.22.0",
    4393                         "resolved": "https://registry.npmjs.org/babel-plugin-transform-function-bind/-/babel-plugin-transform-function-bind-6.22.0.tgz",
    4394                         "integrity": "sha1-xvuOlqwpajELjPjqQBRiQH3fapc=",
    4395                         "dev": true,
    4396                         "requires": {
    4397                                 "babel-plugin-syntax-function-bind": "^6.8.0",
    4398                                 "babel-runtime": "^6.22.0"
    4399                         }
    4400                 },
    4401                 "babel-plugin-transform-object-rest-spread": {
    4402                         "version": "6.26.0",
    4403                         "resolved": "https://registry.npmjs.org/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.26.0.tgz",
    4404                         "integrity": "sha1-DzZpLVD+9rfi1LOsFHgTepY7ewY=",
    4405                         "dev": true,
    4406                         "requires": {
    4407                                 "babel-plugin-syntax-object-rest-spread": "^6.8.0",
    4408                                 "babel-runtime": "^6.26.0"
    4409                         }
    4410                 },
    44114172                "babel-plugin-transform-regenerator": {
    44124173                        "version": "6.26.0",
    44134174                        "resolved": "https://registry.npmjs.org/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz",
     
    44664227                                "babel-plugin-jest-hoist": "^24.6.0"
    44674228                        }
    44684229                },
    4469                 "babel-preset-stage-0": {
    4470                         "version": "6.24.1",
    4471                         "resolved": "https://registry.npmjs.org/babel-preset-stage-0/-/babel-preset-stage-0-6.24.1.tgz",
    4472                         "integrity": "sha1-VkLRUEL5E4TX5a+LyIsduVsDnmo=",
    4473                         "dev": true,
    4474                         "requires": {
    4475                                 "babel-plugin-transform-do-expressions": "^6.22.0",
    4476                                 "babel-plugin-transform-function-bind": "^6.22.0",
    4477                                 "babel-preset-stage-1": "^6.24.1"
    4478                         }
    4479                 },
    4480                 "babel-preset-stage-1": {
    4481                         "version": "6.24.1",
    4482                         "resolved": "https://registry.npmjs.org/babel-preset-stage-1/-/babel-preset-stage-1-6.24.1.tgz",
    4483                         "integrity": "sha1-dpLNfc1oSZB+auSgqFWJz7niv7A=",
    4484                         "dev": true,
    4485                         "requires": {
    4486                                 "babel-plugin-transform-class-constructor-call": "^6.24.1",
    4487                                 "babel-plugin-transform-export-extensions": "^6.22.0",
    4488                                 "babel-preset-stage-2": "^6.24.1"
    4489                         }
    4490                 },
    4491                 "babel-preset-stage-2": {
    4492                         "version": "6.24.1",
    4493                         "resolved": "https://registry.npmjs.org/babel-preset-stage-2/-/babel-preset-stage-2-6.24.1.tgz",
    4494                         "integrity": "sha1-2eKWD7PXEYfw5k7sYrwHdnIZvcE=",
    4495                         "dev": true,
    4496                         "requires": {
    4497                                 "babel-plugin-syntax-dynamic-import": "^6.18.0",
    4498                                 "babel-plugin-transform-class-properties": "^6.24.1",
    4499                                 "babel-plugin-transform-decorators": "^6.24.1",
    4500                                 "babel-preset-stage-3": "^6.24.1"
    4501                         }
    4502                 },
    4503                 "babel-preset-stage-3": {
    4504                         "version": "6.24.1",
    4505                         "resolved": "https://registry.npmjs.org/babel-preset-stage-3/-/babel-preset-stage-3-6.24.1.tgz",
    4506                         "integrity": "sha1-g2raCp56f6N8sTj7kyb4eTSkg5U=",
    4507                         "dev": true,
    4508                         "requires": {
    4509                                 "babel-plugin-syntax-trailing-function-commas": "^6.22.0",
    4510                                 "babel-plugin-transform-async-generator-functions": "^6.24.1",
    4511                                 "babel-plugin-transform-async-to-generator": "^6.24.1",
    4512                                 "babel-plugin-transform-exponentiation-operator": "^6.24.1",
    4513                                 "babel-plugin-transform-object-rest-spread": "^6.22.0"
    4514                         }
    4515                 },
    45164230                "babel-register": {
    45174231                        "version": "6.26.0",
    45184232                        "resolved": "https://registry.npmjs.org/babel-register/-/babel-register-6.26.0.tgz",
     
    61705884                                }
    61715885                        }
    61725886                },
    6173                 "copyfiles": {
    6174                         "version": "2.1.1",
    6175                         "resolved": "https://registry.npmjs.org/copyfiles/-/copyfiles-2.1.1.tgz",
    6176                         "integrity": "sha512-y6DZHve80whydXzBal7r70TBgKMPKesVRR1Sn/raUu7Jh/i7iSLSyGvYaq0eMJ/3Y/CKghwzjY32q1WzEnpp3Q==",
    6177                         "dev": true,
    6178                         "requires": {
    6179                                 "glob": "^7.0.5",
    6180                                 "minimatch": "^3.0.3",
    6181                                 "mkdirp": "^0.5.1",
    6182                                 "noms": "0.0.0",
    6183                                 "through2": "^2.0.1",
    6184                                 "yargs": "^13.2.4"
    6185                         },
    6186                         "dependencies": {
    6187                                 "ansi-regex": {
    6188                                         "version": "4.1.0",
    6189                                         "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz",
    6190                                         "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==",
    6191                                         "dev": true
    6192                                 },
    6193                                 "ansi-styles": {
    6194                                         "version": "3.2.1",
    6195                                         "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
    6196                                         "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
    6197                                         "dev": true,
    6198                                         "requires": {
    6199                                                 "color-convert": "^1.9.0"
    6200                                         }
    6201                                 },
    6202                                 "camelcase": {
    6203                                         "version": "5.3.1",
    6204                                         "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz",
    6205                                         "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==",
    6206                                         "dev": true
    6207                                 },
    6208                                 "cliui": {
    6209                                         "version": "5.0.0",
    6210                                         "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz",
    6211                                         "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==",
    6212                                         "dev": true,
    6213                                         "requires": {
    6214                                                 "string-width": "^3.1.0",
    6215                                                 "strip-ansi": "^5.2.0",
    6216                                                 "wrap-ansi": "^5.1.0"
    6217                                         }
    6218                                 },
    6219                                 "find-up": {
    6220                                         "version": "3.0.0",
    6221                                         "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz",
    6222                                         "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==",
    6223                                         "dev": true,
    6224                                         "requires": {
    6225                                                 "locate-path": "^3.0.0"
    6226                                         }
    6227                                 },
    6228                                 "get-caller-file": {
    6229                                         "version": "2.0.5",
    6230                                         "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
    6231                                         "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
    6232                                         "dev": true
    6233                                 },
    6234                                 "locate-path": {
    6235                                         "version": "3.0.0",
    6236                                         "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz",
    6237                                         "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==",
    6238                                         "dev": true,
    6239                                         "requires": {
    6240                                                 "p-locate": "^3.0.0",
    6241                                                 "path-exists": "^3.0.0"
    6242                                         }
    6243                                 },
    6244                                 "p-limit": {
    6245                                         "version": "2.2.0",
    6246                                         "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz",
    6247                                         "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==",
    6248                                         "dev": true,
    6249                                         "requires": {
    6250                                                 "p-try": "^2.0.0"
    6251                                         }
    6252                                 },
    6253                                 "p-locate": {
    6254                                         "version": "3.0.0",
    6255                                         "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz",
    6256                                         "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==",
    6257                                         "dev": true,
    6258                                         "requires": {
    6259                                                 "p-limit": "^2.0.0"
    6260                                         }
    6261                                 },
    6262                                 "p-try": {
    6263                                         "version": "2.2.0",
    6264                                         "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
    6265                                         "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
    6266                                         "dev": true
    6267                                 },
    6268                                 "require-main-filename": {
    6269                                         "version": "2.0.0",
    6270                                         "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz",
    6271                                         "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==",
    6272                                         "dev": true
    6273                                 },
    6274                                 "string-width": {
    6275                                         "version": "3.1.0",
    6276                                         "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz",
    6277                                         "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==",
    6278                                         "dev": true,
    6279                                         "requires": {
    6280                                                 "emoji-regex": "^7.0.1",
    6281                                                 "is-fullwidth-code-point": "^2.0.0",
    6282                                                 "strip-ansi": "^5.1.0"
    6283                                         }
    6284                                 },
    6285                                 "strip-ansi": {
    6286                                         "version": "5.2.0",
    6287                                         "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
    6288                                         "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==",
    6289                                         "dev": true,
    6290                                         "requires": {
    6291                                                 "ansi-regex": "^4.1.0"
    6292                                         }
    6293                                 },
    6294                                 "wrap-ansi": {
    6295                                         "version": "5.1.0",
    6296                                         "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz",
    6297                                         "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==",
    6298                                         "dev": true,
    6299                                         "requires": {
    6300                                                 "ansi-styles": "^3.2.0",
    6301                                                 "string-width": "^3.0.0",
    6302                                                 "strip-ansi": "^5.0.0"
    6303                                         }
    6304                                 },
    6305                                 "y18n": {
    6306                                         "version": "4.0.0",
    6307                                         "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz",
    6308                                         "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==",
    6309                                         "dev": true
    6310                                 },
    6311                                 "yargs": {
    6312                                         "version": "13.3.0",
    6313                                         "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.0.tgz",
    6314                                         "integrity": "sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA==",
    6315                                         "dev": true,
    6316                                         "requires": {
    6317                                                 "cliui": "^5.0.0",
    6318                                                 "find-up": "^3.0.0",
    6319                                                 "get-caller-file": "^2.0.1",
    6320                                                 "require-directory": "^2.1.1",
    6321                                                 "require-main-filename": "^2.0.0",
    6322                                                 "set-blocking": "^2.0.0",
    6323                                                 "string-width": "^3.0.0",
    6324                                                 "which-module": "^2.0.0",
    6325                                                 "y18n": "^4.0.0",
    6326                                                 "yargs-parser": "^13.1.1"
    6327                                         }
    6328                                 },
    6329                                 "yargs-parser": {
    6330                                         "version": "13.1.1",
    6331                                         "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.1.tgz",
    6332                                         "integrity": "sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==",
    6333                                         "dev": true,
    6334                                         "requires": {
    6335                                                 "camelcase": "^5.0.0",
    6336                                                 "decamelize": "^1.2.0"
    6337                                         }
    6338                                 }
    6339                         }
    6340                 },
    63415887                "core-js": {
    63425888                        "version": "3.1.4",
    63435889                        "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.1.4.tgz",
     
    64515997                                "sha.js": "^2.4.8"
    64525998                        }
    64535999                },
    6454                 "cross-env": {
    6455                         "version": "5.2.0",
    6456                         "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-5.2.0.tgz",
    6457                         "integrity": "sha512-jtdNFfFW1hB7sMhr/H6rW1Z45LFqyI431m3qU6bFXcQ3Eh7LtBuG3h74o7ohHZ3crrRkkqHlo4jYHFPcjroANg==",
    6458                         "dev": true,
    6459                         "requires": {
    6460                                 "cross-spawn": "^6.0.5",
    6461                                 "is-windows": "^1.0.0"
    6462                         },
    6463                         "dependencies": {
    6464                                 "cross-spawn": {
    6465                                         "version": "6.0.5",
    6466                                         "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz",
    6467                                         "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==",
    6468                                         "dev": true,
    6469                                         "requires": {
    6470                                                 "nice-try": "^1.0.4",
    6471                                                 "path-key": "^2.0.1",
    6472                                                 "semver": "^5.5.0",
    6473                                                 "shebang-command": "^1.2.0",
    6474                                                 "which": "^1.2.9"
    6475                                         }
    6476                                 }
    6477                         }
    6478                 },
    64796000                "cross-spawn": {
    64806001                        "version": "5.1.0",
    64816002                        "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz",
     
    64866007                                "which": "^1.2.9"
    64876008                        }
    64886009                },
    6489                 "cross-var": {
    6490                         "version": "1.1.0",
    6491                         "resolved": "https://registry.npmjs.org/cross-var/-/cross-var-1.1.0.tgz",
    6492                         "integrity": "sha1-8PDUuyNdlRONGlOYQtKQ8A23HNY=",
    6493                         "dev": true,
    6494                         "requires": {
    6495                                 "babel-preset-es2015": "^6.18.0",
    6496                                 "babel-preset-stage-0": "^6.16.0",
    6497                                 "babel-register": "^6.18.0",
    6498                                 "cross-spawn": "^5.0.1",
    6499                                 "exit": "^0.1.2"
    6500                         }
    6501                 },
    65026010                "crypto-browserify": {
    65036011                        "version": "3.12.0",
    65046012                        "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz",
     
    76097117                                "is-obj": "^1.0.0"
    76107118                        }
    76117119                },
    7612                 "dotenv-cli": {
    7613                         "version": "2.0.1",
    7614                         "resolved": "https://registry.npmjs.org/dotenv-cli/-/dotenv-cli-2.0.1.tgz",
    7615                         "integrity": "sha512-RnjvnE+r27ni9j93w1ddMs9mQgxWlRozSfby7M4xVDJ5/DgLOFFAP92JrmXHkpn8dXCy+OObRx+w5wx0Dc3yww==",
    7616                         "dev": true,
    7617                         "requires": {
    7618                                 "cross-spawn": "^4.0.0",
    7619                                 "dotenv": "^7.0.0",
    7620                                 "dotenv-expand": "^5.0.0",
    7621                                 "minimist": "^1.1.3"
    7622                         },
    7623                         "dependencies": {
    7624                                 "cross-spawn": {
    7625                                         "version": "4.0.2",
    7626                                         "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-4.0.2.tgz",
    7627                                         "integrity": "sha1-e5JHYhwjrf3ThWAEqCPL45dCTUE=",
    7628                                         "dev": true,
    7629                                         "requires": {
    7630                                                 "lru-cache": "^4.0.1",
    7631                                                 "which": "^1.2.9"
    7632                                         }
    7633                                 },
    7634                                 "dotenv": {
    7635                                         "version": "7.0.0",
    7636                                         "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-7.0.0.tgz",
    7637                                         "integrity": "sha512-M3NhsLbV1i6HuGzBUH8vXrtxOk+tWmzWKDMbAVSUp3Zsjm7ywFeuwrUXhmhQyRK1q5B5GGy7hcXPbj3bnfZg2g==",
    7638                                         "dev": true
    7639                                 },
    7640                                 "minimist": {
    7641                                         "version": "1.2.0",
    7642                                         "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
    7643                                         "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
    7644                                         "dev": true
    7645                                 }
    7646                         }
     7120                "dotenv": {
     7121                        "version": "8.0.0",
     7122                        "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.0.0.tgz",
     7123                        "integrity": "sha512-30xVGqjLjiUOArT4+M5q9sYdvuR4riM6yK9wMcas9Vbp6zZa+ocC9dp6QoftuhTPhFAiLK/0C5Ni2nou/Bk8lg==",
     7124                        "dev": true
    76477125                },
    76487126                "dotenv-expand": {
    76497127                        "version": "5.1.0",
     
    1614315621                        "dev": true,
    1614415622                        "optional": true
    1614515623                },
    16146                 "noms": {
    16147                         "version": "0.0.0",
    16148                         "resolved": "https://registry.npmjs.org/noms/-/noms-0.0.0.tgz",
    16149                         "integrity": "sha1-2o69nzr51nYJGbJ9nNyAkqczKFk=",
    16150                         "dev": true,
    16151                         "requires": {
    16152                                 "inherits": "^2.0.1",
    16153                                 "readable-stream": "~1.0.31"
    16154                         },
    16155                         "dependencies": {
    16156                                 "isarray": {
    16157                                         "version": "0.0.1",
    16158                                         "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
    16159                                         "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=",
    16160                                         "dev": true
    16161                                 },
    16162                                 "readable-stream": {
    16163                                         "version": "1.0.34",
    16164                                         "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz",
    16165                                         "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=",
    16166                                         "dev": true,
    16167                                         "requires": {
    16168                                                 "core-util-is": "~1.0.0",
    16169                                                 "inherits": "~2.0.1",
    16170                                                 "isarray": "0.0.1",
    16171                                                 "string_decoder": "~0.10.x"
    16172                                         }
    16173                                 },
    16174                                 "string_decoder": {
    16175                                         "version": "0.10.31",
    16176                                         "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
    16177                                         "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=",
    16178                                         "dev": true
    16179                                 }
    16180                         }
    16181                 },
    1618215624                "nopt": {
    1618315625                        "version": "3.0.6",
    1618415626                        "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz",
  • package.json

    diff --git a/package.json b/package.json
    index 7d8d8d7df9..54a7eed651 100644
    a b  
    2222                "babel-jest": "24.8.0",
    2323                "check-node-version": "3.2.0",
    2424                "copy-webpack-plugin": "^4.6.0",
    25                 "copyfiles": "2.1.1",
    2625                "core-js": "3.1.4",
    27                 "cross-env": "5.2.0",
    28                 "cross-var": "1.1.0",
    2926                "cssnano": "4.1.8",
    30                 "dotenv-cli": "2.0.1",
     27                "dotenv": "8.0.0",
     28                "dotenv-expand": "5.1.0",
    3129                "grunt": "~1.0.3",
    3230                "grunt-banner": "^0.6.0",
    3331                "grunt-contrib-clean": "~2.0.0",
     
    129127                "test": "grunt test",
    130128                "watch": "grunt watch",
    131129                "grunt": "grunt",
    132                 "env:start": "dotenv npm run env:__start-next",
    133                 "env:__start-next": "docker-compose -f ./tools/local-env/docker-compose.yml up -d",
    134                 "env:stop": "dotenv npm run env:__stop-next",
    135                 "env:clean": "dotenv npm run env:__stop-next -- -- -v --remove-orphans",
    136                 "env:reset": "dotenv npm run env:__stop-next -- -- --rmi all -v --remove-orphans",
    137                 "env:__stop-next": "docker-compose -f ./tools/local-env/docker-compose.yml -f ./tools/local-env/docker-compose.scripts.yml down",
    138                 "env:install": "dotenv npm run env:__install-next",
    139                 "env:__install-next": "npm run env:__install-config && npm run env:__install-config-define-wp_debug && npm run env:__install-config-define-wp_debug_log && npm run env:__install-config-define-wp_debug_display && npm run env:__install-config-define-script_debug && copyfiles -f src/wp-config.php . && npm run env:__reset-site && npm run env:__install-site",
    140                 "env:__install-config": "cross-var npm run env:__cli-next config create -- --dbname=wordpress_develop --dbuser=root --dbpass=password --dbhost=mysql --path=/var/www/src --force",
    141                 "env:__install-config-define-wp_debug": "cross-var npm run env:__cli-next config set WP_DEBUG $LOCAL_WP_DEBUG -- --raw",
    142                 "env:__install-config-define-wp_debug_log": "cross-var npm run env:__cli-next config set WP_DEBUG_LOG $LOCAL_WP_DEBUG_LOG -- --raw",
    143                 "env:__install-config-define-wp_debug_display": "cross-var npm run env:__cli-next config set WP_DEBUG_DISPLAY $LOCAL_WP_DEBUG_DISPLAY -- --raw",
    144                 "env:__install-config-define-script_debug": "cross-var npm run env:__cli-next config set SCRIPT_DEBUG $LOCAL_SCRIPT_DEBUG -- --raw",
    145                 "env:__install-site": "cross-var wait-on tcp:localhost:$LOCAL_PORT && cross-var npm run env:__cli-next core install -- --title=WPDEV --admin_user=admin --admin_password=password --admin_email=test@test.com --skip-email --url=http://localhost:$LOCAL_PORT --quiet",
    146                 "env:__reset-site": "cross-var wait-on tcp:localhost:$LOCAL_PORT && npm run env:__cli-next db reset -- --yes --quiet",
    147                 "env:cli": "dotenv npm run env:__cli-next",
    148                 "env:__cli-next": "docker-compose -f ./tools/local-env/docker-compose.yml -f ./tools/local-env/docker-compose.scripts.yml run --rm cli",
    149                 "env:logs": "docker-compose -f ./tools/local-env/docker-compose.yml -f ./tools/local-env/docker-compose.scripts.yml logs",
    150                 "env:pull": "dotenv npm run env:__pull-next",
    151                 "env:__pull-next": "docker-compose -f ./tools/local-env/docker-compose.yml -f ./tools/local-env/docker-compose.scripts.yml pull",
    152                 "test:e2e": "dotenv npm run test:__e2e-next",
    153                 "test:__e2e-next": "cross-var cross-env WP_BASE_URL=http://localhost:$LOCAL_PORT wp-scripts test-e2e --config tests/e2e/jest.config.js",
    154                 "test:php": "dotenv npm run test:__php-next",
    155                 "test:__php-next": "docker-compose -f ./tools/local-env/docker-compose.yml -f ./tools/local-env/docker-compose.scripts.yml run --rm phpunit phpunit"
     130                "env:start": "node ./tools/local-env/scripts/start.js",
     131                "env:stop": "node ./tools/local-env/scripts/docker.js down",
     132                "env:clean": "node ./tools/local-env/scripts/docker.js down -v --remove-orphans",
     133                "env:reset": "node ./tools/local-env/scripts/docker.js down --rmi all -v --remove-orphans",
     134                "env:install": "node ./tools/local-env/scripts/install.js",
     135                "env:cli": "node ./tools/local-env/scripts/docker.js run cli",
     136                "env:logs": "node ./tools/local-env/scripts/docker.js logs",
     137                "env:pull": "node ./tools/local-env/scripts/docker.js pull",
     138                "test:php": "node ./tools/local-env/scripts/docker.js run --rm phpunit phpunit",
     139                "test:e2e": "node ./tests/e2e/run-tests.js"
    156140        }
    157141}
  • new file tests/e2e/run-tests.js

    diff --git a/tests/e2e/run-tests.js b/tests/e2e/run-tests.js
    new file mode 100644
    index 0000000000..b930e92c61
    - +  
     1const dotenv = require( 'dotenv' );
     2const dotenv_expand = require( 'dotenv-expand' );
     3const { execSync } = require( 'child_process' );
     4
     5// WP_BASE_URL interpolates LOCAL_PORT, so needs to be parsed by dotenv_expand().
     6dotenv_expand( dotenv.config() );
     7
     8// Run the tests, passing additional arguments through to the test script.
     9execSync( 'wp-scripts test-e2e --config tests/e2e/jest.config.js ' + process.argv.slice( 2 ).join( ' ' ), { stdio: 'inherit' } );
  • tools/local-env/default.template

    diff --git a/tools/local-env/default.template b/tools/local-env/default.template
    index e0a161926b..21bfac0e1f 100644
    a b server { 
    1313
    1414        root /var/www/${LOCAL_DIR};
    1515
     16        absolute_redirect off;
     17
    1618        location / {
    1719                try_files $uri $uri/ /index.php?$args;
    1820        }
  • deleted file tools/local-env/docker-compose.scripts.yml

    diff --git a/tools/local-env/docker-compose.scripts.yml b/tools/local-env/docker-compose.scripts.yml
    deleted file mode 100644
    index f5a5153545..0000000000
    + -  
    1 version: '3.7'
    2 
    3 services:
    4 
    5   ##
    6   # The WP CLI container.
    7   ##
    8   cli:
    9     image: wordpressdevelop/cli:${LOCAL_PHP-latest}
    10 
    11     networks:
    12       - wpdevnet
    13 
    14     environment:
    15       LOCAL_PHP_XDEBUG: ${LOCAL_PHP_XDEBUG-false}
    16       LOCAL_PHP_MEMCACHED: ${LOCAL_PHP_MEMCACHED-false}
    17 
    18     volumes:
    19       - ../../:/var/www
    20 
    21     # The init directive ensures the command runs with a PID > 1, so Ctrl+C works correctly.
    22     init: true
    23 
    24   ##
    25   # The PHPUnit container.
    26   ##
    27   phpunit:
    28     image: wordpressdevelop/phpunit:${LOCAL_PHP-latest}
    29 
    30     networks:
    31       - wpdevnet
    32 
    33     environment:
    34       LOCAL_PHP_XDEBUG: ${LOCAL_PHP_XDEBUG-false}
    35       LOCAL_PHP_MEMCACHED: ${LOCAL_PHP_MEMCACHED-false}
    36 
    37     volumes:
    38       - ./phpunit-config.ini:/usr/local/etc/php/conf.d/phpunit-config.ini
    39       - ../../:/wordpress-develop
    40       - phpunit-uploads:/wordpress-develop/${LOCAL_DIR-src}/wp-content/uploads
    41 
    42     # The init directive ensures the command runs with a PID > 1, so Ctrl+C works correctly.
    43     init: true
    44 
    45     depends_on:
    46       - mysql
    47 
    48 volumes:
    49   # Using a volume for the uploads directory improves PHPUnit performance.
    50   phpunit-uploads: {}
  • new file tools/local-env/scripts/docker.js

    diff --git a/tools/local-env/scripts/docker.js b/tools/local-env/scripts/docker.js
    new file mode 100644
    index 0000000000..99eabbf620
    - +  
     1const dotenv = require( 'dotenv' );
     2const { execSync } = require( 'child_process' );
     3dotenv.config();
     4
     5// Execute any docker-compose command passed to this script.
     6execSync( 'docker-compose ' + process.argv.slice( 2 ).join( ' ' ), { stdio: 'inherit' } );
  • new file tools/local-env/scripts/install.js

    diff --git a/tools/local-env/scripts/install.js b/tools/local-env/scripts/install.js
    new file mode 100644
    index 0000000000..32b68d2559
    - +  
     1const dotenv = require( 'dotenv' );
     2const wait_on = require( 'wait-on' );
     3const { execSync } = require( 'child_process' );
     4const { renameSync } = require( 'fs' );
     5
     6dotenv.config();
     7
     8// Create wp-config.php.
     9wp_cli( 'config create --dbname=wordpress_develop --dbuser=root --dbpass=password --dbhost=mysql --path=/var/www/src --force' );
     10
     11// Add the debug settings to wp-config.php.
     12// Windows requires this to be done as an additional step, rather than using the --extra-php option in the previous step.
     13wp_cli( `config set WP_DEBUG ${process.env.LOCAL_WP_DEBUG} --raw` );
     14wp_cli( `config set WP_DEBUG_LOG ${process.env.LOCAL_WP_DEBUG_LOG} --raw` );
     15wp_cli( `config set WP_DEBUG_DISPLAY ${process.env.LOCAL_WP_DEBUG_DISPLAY} --raw` );
     16wp_cli( `config set SCRIPT_DEBUG ${process.env.LOCAL_SCRIPT_DEBUG} --raw` );
     17
     18// Move wp-config.php to the base directory, so it doesn't get mixed up in the src or build directories.
     19renameSync( 'src/wp-config.php', 'wp-config.php' );
     20
     21// Once the site is available, install WordPress!
     22wait_on( { resources: [ `tcp:localhost:${process.env.LOCAL_PORT}`] } )
     23        .then( () => {
     24                wp_cli( 'db reset --yes' );
     25                wp_cli( `core install --title="WordPress Develop" --admin_user=admin --admin_password=password --admin_email=test@test.com --skip-email --url=http://localhost:${process.env.LOCAL_PORT}` );
     26        } );
     27
     28/**
     29 * Runs WP-CLI commands in the Docker environment.
     30 *
     31 * @param {string} cmd The WP-CLI command to run.
     32 */
     33function wp_cli( cmd ) {
     34        execSync( `docker-compose run --rm cli ${cmd}`, { stdio: 'inherit' } );
     35}
  • new file tools/local-env/scripts/start.js

    diff --git a/tools/local-env/scripts/start.js b/tools/local-env/scripts/start.js
    new file mode 100644
    index 0000000000..3ea1c96ecc
    - +  
     1const dotenv = require( 'dotenv' );
     2const { execSync } = require( 'child_process' );
     3
     4dotenv.config();
     5
     6// Start the local-env containers.
     7execSync( 'docker-compose up -d wordpress-develop', { stdio: 'inherit' } );
     8
     9// If Docker Toolbox is being used, we need to manually forward LOCAL_PORT to the Docker VM.
     10if ( process.env.DOCKER_TOOLBOX_INSTALL_PATH ) {
     11        // VBoxManage is added to the PATH on every platform except Windows.
     12        const vboxmanage = process.env.VBOX_MSI_INSTALL_PATH ? `${process.env.VBOX_MSI_INSTALL_PATH}/VBoxManage` : 'VBoxManage'
     13        execSync( `"${vboxmanage}" controlvm "${process.env.DOCKER_MACHINE_NAME}" natpf1 "tcp-port${process.env.LOCAL_PORT},tcp,127.0.0.1,${process.env.LOCAL_PORT},,${process.env.LOCAL_PORT}"`, { stdio: 'inherit' } );
     14}