Make WordPress Core

Ticket #47767: 47767.diff

File 47767.diff, 50.2 KB (added by pento, 6 years ago)
  • new file .env

    diff --git a/.env b/.env
    new file mode 100644
    index 0000000000..5d57cfb221
    - +  
     1LOCAL_PORT=8889
     2LOCAL_DIR=src
  • .travis.yml

    diff --git a/.travis.yml b/.travis.yml
    index 7725c722d5..9f4e5ce3a7 100644
    a b env: 
    1313matrix:
    1414  include:
    1515  - php: 7.2
    16     env: WP_TRAVISCI=e2e
     16    env: WP_TRAVISCI=travis:e2e
     17    services:
     18      - docker
     19    addons:
     20      apt:
     21        packages:
     22          - docker-ce
    1723  - php: 7.2
    1824    env: WP_TRAVISCI=travis:phpcs
    1925  - php: 7.1
    before_install: 
    4349      sed -i "s/yourpasswordhere//" wp-tests-config.php
    4450      travis_retry svn checkout https://plugins.svn.wordpress.org/wordpress-importer/tags/0.6.3/ tests/phpunit/data/plugins/wordpress-importer
    4551  fi
     52- |
     53  if [[ "$WP_TRAVISCI" == "travis:e2e" ]]; then
     54    sudo rm /usr/local/bin/docker-compose
     55    curl -L https://github.com/docker/compose/releases/download/1.24.0/docker-compose-`uname -s`-`uname -m` > docker-compose
     56    chmod +x docker-compose
     57    sudo mv docker-compose /usr/local/bin
     58  fi
    4659- |
    4760  if [[ "$WP_TRAVIS_OBJECT_CACHE" == "true" ]]; then
    4861    cp tests/phpunit/includes/object-cache.php src/wp-content/object-cache.php
    before_script: 
    93106- nvm install 10.13.0
    94107- npm install
    95108- npm prune
     109- |
     110  # Get ready for launching docker
     111  if [[ "$WP_TRAVISCI" == "travis:e2e" ]]; then
     112    export LOCAL_DIR=build
     113    npm run env:start
     114    npm run grunt build
     115    npm run env:install
     116  fi
    96117- mysql --version
    97118- phpenv versions
    98119- php --version
    before_script: 
    107128- locale -a
    108129script:
    109130- |
    110   if [[ "$WP_TRAVISCI" == "e2e" ]]; then
    111     npm run env:start
    112     npm run env:reset-site
     131  if [[ "$WP_TRAVISCI" == "travis:e2e" ]]; then
    113132    npm run test:e2e
    114133  else
    115134    npm run grunt $WP_TRAVISCI
  • package-lock.json

    diff --git a/package-lock.json b/package-lock.json
    index 8876f74f06..06e9c2fead 100644
    a b  
    10841084                        "resolved": "https://registry.npmjs.org/@financial-times/useragent_parser/-/useragent_parser-1.0.2.tgz",
    10851085                        "integrity": "sha512-zuJMxn5Qnk7CKl+zrVXDqXs0F+p4tshO6B4s8VenJj34EEVuV4iZIbkGiEFJUbn29z9Mcn6k8yfj9qSCNDcPPQ=="
    10861086                },
     1087                "@hapi/address": {
     1088                        "version": "2.0.0",
     1089                        "resolved": "https://registry.npmjs.org/@hapi/address/-/address-2.0.0.tgz",
     1090                        "integrity": "sha512-mV6T0IYqb0xL1UALPFplXYQmR0twnXG0M6jUswpquqT2sD12BOiCiLy3EvMp/Fy7s3DZElC4/aPjEjo2jeZpvw==",
     1091                        "dev": true
     1092                },
     1093                "@hapi/hoek": {
     1094                        "version": "6.2.4",
     1095                        "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-6.2.4.tgz",
     1096                        "integrity": "sha512-HOJ20Kc93DkDVvjwHyHawPwPkX44sIrbXazAUDiUXaY2R9JwQGo2PhFfnQtdrsIe4igjG2fPgMra7NYw7qhy0A==",
     1097                        "dev": true
     1098                },
     1099                "@hapi/joi": {
     1100                        "version": "15.1.0",
     1101                        "resolved": "https://registry.npmjs.org/@hapi/joi/-/joi-15.1.0.tgz",
     1102                        "integrity": "sha512-n6kaRQO8S+kepUTbXL9O/UOL788Odqs38/VOfoCrATDtTvyfiO3fgjlSRaNkHabpTLgM7qru9ifqXlXbXk8SeQ==",
     1103                        "dev": true,
     1104                        "requires": {
     1105                                "@hapi/address": "2.x.x",
     1106                                "@hapi/hoek": "6.x.x",
     1107                                "@hapi/marker": "1.x.x",
     1108                                "@hapi/topo": "3.x.x"
     1109                        }
     1110                },
     1111                "@hapi/marker": {
     1112                        "version": "1.0.0",
     1113                        "resolved": "https://registry.npmjs.org/@hapi/marker/-/marker-1.0.0.tgz",
     1114                        "integrity": "sha512-JOfdekTXnJexfE8PyhZFyHvHjt81rBFSAbTIRAhF2vv/2Y1JzoKsGqxH/GpZJoF7aEfYok8JVcAHmSz1gkBieA==",
     1115                        "dev": true
     1116                },
     1117                "@hapi/topo": {
     1118                        "version": "3.1.2",
     1119                        "resolved": "https://registry.npmjs.org/@hapi/topo/-/topo-3.1.2.tgz",
     1120                        "integrity": "sha512-r+aumOqJ5QbD6aLPJWqVjMAPsx5pZKz+F5yPqXZ/WWG9JTtHbQqlzrJoknJ0iJxLj9vlXtmpSdjlkszseeG8OA==",
     1121                        "dev": true,
     1122                        "requires": {
     1123                                "@hapi/hoek": "8.x.x"
     1124                        },
     1125                        "dependencies": {
     1126                                "@hapi/hoek": {
     1127                                        "version": "8.0.2",
     1128                                        "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-8.0.2.tgz",
     1129                                        "integrity": "sha512-O6o6mrV4P65vVccxymuruucb+GhP2zl9NLCG8OdoFRS8BEGw3vwpPp20wpAtpbQQxz1CEUtmxJGgWhjq1XA3qw==",
     1130                                        "dev": true
     1131                                }
     1132                        }
     1133                },
    10871134                "@jest/console": {
    10881135                        "version": "24.7.1",
    10891136                        "resolved": "https://registry.npmjs.org/@jest/console/-/console-24.7.1.tgz",
     
    32673314                        "dependencies": {
    32683315                                "file-type": {
    32693316                                        "version": "3.9.0",
    3270                                         "resolved": "https://registry.npmjs.org/file-type/-/file-type-3.9.0.tgz",
     3317                                        "resolved": "http://registry.npmjs.org/file-type/-/file-type-3.9.0.tgz",
    32713318                                        "integrity": "sha1-JXoHg4TR24CHvESdEH1SpSZyuek=",
    32723319                                        "dev": true,
    32733320                                        "optional": true
     
    36723719                                "trim-right": "^1.0.1"
    36733720                        }
    36743721                },
     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                },
    36753744                "babel-helper-call-delegate": {
    36763745                        "version": "6.24.1",
    36773746                        "resolved": "https://registry.npmjs.org/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz",
     
    36943763                                "lodash": "^4.17.4"
    36953764                        }
    36963765                },
     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                },
    36973789                "babel-helper-function-name": {
    36983790                        "version": "6.24.1",
    36993791                        "resolved": "https://registry.npmjs.org/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz",
     
    37433835                                "lodash": "^4.17.4"
    37443836                        }
    37453837                },
     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                },
    37463851                "babel-helper-replace-supers": {
    37473852                        "version": "6.24.1",
    37483853                        "resolved": "https://registry.npmjs.org/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz",
     
    39104015                                "@types/babel__traverse": "^7.0.6"
    39114016                        }
    39124017                },
     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                },
    39134158                "babel-plugin-transform-es2015-arrow-functions": {
    39144159                        "version": "6.22.0",
    39154160                        "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz",
     
    41224367                                "regexpu-core": "^2.0.0"
    41234368                        }
    41244369                },
     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                },
    41254411                "babel-plugin-transform-regenerator": {
    41264412                        "version": "6.26.0",
    41274413                        "resolved": "https://registry.npmjs.org/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz",
     
    41804466                                "babel-plugin-jest-hoist": "^24.6.0"
    41814467                        }
    41824468                },
     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                },
    41834516                "babel-register": {
    41844517                        "version": "6.26.0",
    41854518                        "resolved": "https://registry.npmjs.org/babel-register/-/babel-register-6.26.0.tgz",
     
    44214754                                },
    44224755                                "uuid": {
    44234756                                        "version": "2.0.3",
    4424                                         "resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.3.tgz",
     4757                                        "resolved": "http://registry.npmjs.org/uuid/-/uuid-2.0.3.tgz",
    44254758                                        "integrity": "sha1-Z+LoY3lyFVMN/zGOW/nc6/1Hsho=",
    44264759                                        "dev": true,
    44274760                                        "optional": true
     
    45004833                },
    45014834                "bl": {
    45024835                        "version": "1.2.2",
    4503                         "resolved": "https://registry.npmjs.org/bl/-/bl-1.2.2.tgz",
     4836                        "resolved": "http://registry.npmjs.org/bl/-/bl-1.2.2.tgz",
    45044837                        "integrity": "sha512-e8tQYnZodmebYDWGH7KMRvtzKXaJHx3BbilrgZCfvyLUYdKpK1t5PSPmpkny/SgiTSCnjfLW7v5rlONXVFkQEA==",
    45054838                        "dev": true,
    45064839                        "optional": true,
     
    46865019                },
    46875020                "browserify-aes": {
    46885021                        "version": "1.2.0",
    4689                         "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz",
     5022                        "resolved": "http://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz",
    46905023                        "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==",
    46915024                        "dev": true,
    46925025                        "requires": {
     
    48385171                        "dependencies": {
    48395172                                "file-type": {
    48405173                                        "version": "3.9.0",
    4841                                         "resolved": "https://registry.npmjs.org/file-type/-/file-type-3.9.0.tgz",
     5174                                        "resolved": "http://registry.npmjs.org/file-type/-/file-type-3.9.0.tgz",
    48425175                                        "integrity": "sha1-JXoHg4TR24CHvESdEH1SpSZyuek=",
    48435176                                        "dev": true,
    48445177                                        "optional": true
    48455178                                },
    48465179                                "uuid": {
    48475180                                        "version": "2.0.3",
    4848                                         "resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.3.tgz",
     5181                                        "resolved": "http://registry.npmjs.org/uuid/-/uuid-2.0.3.tgz",
    48495182                                        "integrity": "sha1-Z+LoY3lyFVMN/zGOW/nc6/1Hsho=",
    48505183                                        "dev": true,
    48515184                                        "optional": true
     
    57186051                        "dependencies": {
    57196052                                "cacache": {
    57206053                                        "version": "10.0.4",
    5721                                         "resolved": "https://registry.npmjs.org/cacache/-/cacache-10.0.4.tgz",
     6054                                        "resolved": "http://registry.npmjs.org/cacache/-/cacache-10.0.4.tgz",
    57226055                                        "integrity": "sha512-Dph0MzuH+rTQzGPNT9fAnrPmMmjKfST6trxJeK7NQuHRaVw24VzPRWTmg9MpcwOVQZO0E1FBICUlFeNaKPIfHA==",
    57236056                                        "dev": true,
    57246057                                        "requires": {
     
    59506283                                "sha.js": "^2.4.8"
    59516284                        }
    59526285                },
     6286                "cross-env": {
     6287                        "version": "5.2.0",
     6288                        "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-5.2.0.tgz",
     6289                        "integrity": "sha512-jtdNFfFW1hB7sMhr/H6rW1Z45LFqyI431m3qU6bFXcQ3Eh7LtBuG3h74o7ohHZ3crrRkkqHlo4jYHFPcjroANg==",
     6290                        "dev": true,
     6291                        "requires": {
     6292                                "cross-spawn": "^6.0.5",
     6293                                "is-windows": "^1.0.0"
     6294                        },
     6295                        "dependencies": {
     6296                                "cross-spawn": {
     6297                                        "version": "6.0.5",
     6298                                        "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz",
     6299                                        "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==",
     6300                                        "dev": true,
     6301                                        "requires": {
     6302                                                "nice-try": "^1.0.4",
     6303                                                "path-key": "^2.0.1",
     6304                                                "semver": "^5.5.0",
     6305                                                "shebang-command": "^1.2.0",
     6306                                                "which": "^1.2.9"
     6307                                        }
     6308                                }
     6309                        }
     6310                },
    59536311                "cross-spawn": {
    59546312                        "version": "5.1.0",
    59556313                        "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz",
     
    59606318                                "which": "^1.2.9"
    59616319                        }
    59626320                },
     6321                "cross-var": {
     6322                        "version": "1.1.0",
     6323                        "resolved": "https://registry.npmjs.org/cross-var/-/cross-var-1.1.0.tgz",
     6324                        "integrity": "sha1-8PDUuyNdlRONGlOYQtKQ8A23HNY=",
     6325                        "dev": true,
     6326                        "requires": {
     6327                                "babel-preset-es2015": "^6.18.0",
     6328                                "babel-preset-stage-0": "^6.16.0",
     6329                                "babel-register": "^6.18.0",
     6330                                "cross-spawn": "^5.0.1",
     6331                                "exit": "^0.1.2"
     6332                        }
     6333                },
    59636334                "crypto-browserify": {
    59646335                        "version": "3.12.0",
    59656336                        "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz",
     
    70707441                                "is-obj": "^1.0.0"
    70717442                        }
    70727443                },
     7444                "dotenv-cli": {
     7445                        "version": "2.0.1",
     7446                        "resolved": "https://registry.npmjs.org/dotenv-cli/-/dotenv-cli-2.0.1.tgz",
     7447                        "integrity": "sha512-RnjvnE+r27ni9j93w1ddMs9mQgxWlRozSfby7M4xVDJ5/DgLOFFAP92JrmXHkpn8dXCy+OObRx+w5wx0Dc3yww==",
     7448                        "dev": true,
     7449                        "requires": {
     7450                                "cross-spawn": "^4.0.0",
     7451                                "dotenv": "^7.0.0",
     7452                                "dotenv-expand": "^5.0.0",
     7453                                "minimist": "^1.1.3"
     7454                        },
     7455                        "dependencies": {
     7456                                "cross-spawn": {
     7457                                        "version": "4.0.2",
     7458                                        "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-4.0.2.tgz",
     7459                                        "integrity": "sha1-e5JHYhwjrf3ThWAEqCPL45dCTUE=",
     7460                                        "dev": true,
     7461                                        "requires": {
     7462                                                "lru-cache": "^4.0.1",
     7463                                                "which": "^1.2.9"
     7464                                        }
     7465                                },
     7466                                "dotenv": {
     7467                                        "version": "7.0.0",
     7468                                        "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-7.0.0.tgz",
     7469                                        "integrity": "sha512-M3NhsLbV1i6HuGzBUH8vXrtxOk+tWmzWKDMbAVSUp3Zsjm7ywFeuwrUXhmhQyRK1q5B5GGy7hcXPbj3bnfZg2g==",
     7470                                        "dev": true
     7471                                },
     7472                                "minimist": {
     7473                                        "version": "1.2.0",
     7474                                        "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
     7475                                        "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
     7476                                        "dev": true
     7477                                }
     7478                        }
     7479                },
     7480                "dotenv-expand": {
     7481                        "version": "5.1.0",
     7482                        "resolved": "https://registry.npmjs.org/dotenv-expand/-/dotenv-expand-5.1.0.tgz",
     7483                        "integrity": "sha512-YXQl1DSa4/PQyRfgrv6aoNjhasp/p4qs9FjJ4q4cQk+8m4r6k4ZSiEyytKG8f8W9gi8WsQtIObNmKd+tMzNTmA==",
     7484                        "dev": true
     7485                },
    70737486                "download": {
    70747487                        "version": "4.4.3",
    70757488                        "resolved": "https://registry.npmjs.org/download/-/download-4.4.3.tgz",
     
    70967509                },
    70977510                "duplexer": {
    70987511                        "version": "0.1.1",
    7099                         "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz",
     7512                        "resolved": "http://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz",
    71007513                        "integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=",
    71017514                        "dev": true
    71027515                },
     
    1026010673                        "dependencies": {
    1026110674                                "async": {
    1026210675                                        "version": "0.2.10",
    10263                                         "resolved": "https://registry.npmjs.org/async/-/async-0.2.10.tgz",
     10676                                        "resolved": "http://registry.npmjs.org/async/-/async-0.2.10.tgz",
    1026410677                                        "integrity": "sha1-trvgsGdLnXGXCMo43owjfLUmw9E=",
    1026510678                                        "dev": true
    1026610679                                },
     
    1042010833                                },
    1042110834                                "uglify-js": {
    1042210835                                        "version": "2.7.5",
    10423                                         "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.7.5.tgz",
     10836                                        "resolved": "http://registry.npmjs.org/uglify-js/-/uglify-js-2.7.5.tgz",
    1042410837                                        "integrity": "sha1-RhLAx7qu4rp8SH3kkErhIgefLKg=",
    1042510838                                        "dev": true,
    1042610839                                        "requires": {
     
    1043210845                                },
    1043310846                                "yargs": {
    1043410847                                        "version": "3.10.0",
    10435                                         "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz",
     10848                                        "resolved": "http://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz",
    1043610849                                        "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=",
    1043710850                                        "dev": true,
    1043810851                                        "requires": {
     
    1111511528                                "minimalistic-crypto-utils": "^1.0.1"
    1111611529                        }
    1111711530                },
    11118                 "hoek": {
    11119                         "version": "5.0.4",
    11120                         "resolved": "https://registry.npmjs.org/hoek/-/hoek-5.0.4.tgz",
    11121                         "integrity": "sha512-Alr4ZQgoMlnere5FZJsIyfIjORBqZll5POhDsF4q64dPuJR6rNxXdDxtHSQq8OXRurhmx+PWYEE8bXRROY8h0w==",
    11122                         "dev": true
    11123                 },
    1112411531                "hoist-non-react-statics": {
    1112511532                        "version": "2.5.5",
    1112611533                        "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-2.5.5.tgz",
     
    1226712674                        "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
    1226812675                        "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
    1226912676                },
    12270                 "isemail": {
    12271                         "version": "3.2.0",
    12272                         "resolved": "https://registry.npmjs.org/isemail/-/isemail-3.2.0.tgz",
    12273                         "integrity": "sha512-zKqkK+O+dGqevc93KNsbZ/TqTUFd46MwWjYOoMrjIMZ51eU7DtQG3Wmd9SQQT7i7RVnuTPEiYEWHU3MSbxC1Tg==",
    12274                         "dev": true,
    12275                         "requires": {
    12276                                 "punycode": "2.x.x"
    12277                         },
    12278                         "dependencies": {
    12279                                 "punycode": {
    12280                                         "version": "2.1.1",
    12281                                         "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz",
    12282                                         "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==",
    12283                                         "dev": true
    12284                                 }
    12285                         }
    12286                 },
    1228712677                "isexe": {
    1228812678                        "version": "2.0.0",
    1228912679                        "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
     
    1375614146                                }
    1375714147                        }
    1375814148                },
    13759                 "joi": {
    13760                         "version": "13.7.0",
    13761                         "resolved": "https://registry.npmjs.org/joi/-/joi-13.7.0.tgz",
    13762                         "integrity": "sha512-xuY5VkHfeOYK3Hdi91ulocfuFopwgbSORmIwzcwHKESQhC7w1kD5jaVSPnqDxS2I8t3RZ9omCKAxNwXN5zG1/Q==",
    13763                         "dev": true,
    13764                         "requires": {
    13765                                 "hoek": "5.x.x",
    13766                                 "isemail": "3.x.x",
    13767                                 "topo": "3.x.x"
    13768                         }
    13769                 },
    1377014149                "jpegtran-bin": {
    1377114150                        "version": "3.2.0",
    1377214151                        "resolved": "https://registry.npmjs.org/jpegtran-bin/-/jpegtran-bin-3.2.0.tgz",
     
    1637216751                        "dependencies": {
    1637316752                                "progress": {
    1637416753                                        "version": "1.1.8",
    16375                                         "resolved": "https://registry.npmjs.org/progress/-/progress-1.1.8.tgz",
     16754                                        "resolved": "http://registry.npmjs.org/progress/-/progress-1.1.8.tgz",
    1637616755                                        "integrity": "sha1-4mDHj2Fhzdmw5WzD4Khd4Xx6V74=",
    1637716756                                        "dev": true
    1637816757                                }
     
    2052420903                        "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==",
    2052520904                        "dev": true
    2052620905                },
    20527                 "topo": {
    20528                         "version": "3.0.3",
    20529                         "resolved": "https://registry.npmjs.org/topo/-/topo-3.0.3.tgz",
    20530                         "integrity": "sha512-IgpPtvD4kjrJ7CRA3ov2FhWQADwv+Tdqbsf1ZnPUSAtCJ9e1Z44MmoSGDXGk4IppoZA7jd/QRkNddlLJWlUZsQ==",
    20531                         "dev": true,
    20532                         "requires": {
    20533                                 "hoek": "6.x.x"
    20534                         },
    20535                         "dependencies": {
    20536                                 "hoek": {
    20537                                         "version": "6.1.3",
    20538                                         "resolved": "https://registry.npmjs.org/hoek/-/hoek-6.1.3.tgz",
    20539                                         "integrity": "sha512-YXXAAhmF9zpQbC7LEcREFtXfGq5K1fmd+4PHkBq8NUqmzW3G+Dq10bI/i0KucLRwss3YYFQ0fSfoxBZYiGUqtQ==",
    20540                                         "dev": true
    20541                                 }
    20542                         }
    20543                 },
    2054420906                "toposort": {
    2054520907                        "version": "2.0.2",
    2054620908                        "resolved": "https://registry.npmjs.org/toposort/-/toposort-2.0.2.tgz",
     
    2133421696                        }
    2133521697                },
    2133621698                "wait-on": {
    21337                         "version": "3.2.0",
    21338                         "resolved": "https://registry.npmjs.org/wait-on/-/wait-on-3.2.0.tgz",
    21339                         "integrity": "sha512-QUGNKlKLDyY6W/qHdxaRlXUAgLPe+3mLL/tRByHpRNcHs/c7dZXbu+OnJWGNux6tU1WFh/Z8aEwvbuzSAu79Zg==",
     21699                        "version": "3.3.0",
     21700                        "resolved": "https://registry.npmjs.org/wait-on/-/wait-on-3.3.0.tgz",
     21701                        "integrity": "sha512-97dEuUapx4+Y12aknWZn7D25kkjMk16PbWoYzpSdA8bYpVfS6hpl2a2pOWZ3c+Tyt3/i4/pglyZctG3J4V1hWQ==",
    2134021702                        "dev": true,
    2134121703                        "requires": {
    21342                                 "core-js": "^2.5.7",
    21343                                 "joi": "^13.0.0",
     21704                                "@hapi/joi": "^15.0.3",
     21705                                "core-js": "^2.6.5",
    2134421706                                "minimist": "^1.2.0",
    2134521707                                "request": "^2.88.0",
    2134621708                                "rx": "^4.1.0"
  • package.json

    diff --git a/package.json b/package.json
    index 918109d263..e995a54488 100644
    a b  
    2323                "check-node-version": "3.2.0",
    2424                "copy-webpack-plugin": "^4.6.0",
    2525                "core-js": "3.1.4",
     26                "cross-env": "5.2.0",
     27                "cross-var": "1.1.0",
    2628                "cssnano": "4.1.8",
     29                "dotenv-cli": "2.0.1",
    2730                "grunt": "~1.0.3",
    2831                "grunt-banner": "^0.6.0",
    2932                "grunt-contrib-clean": "~2.0.0",
     
    5356                "source-map-loader": "^0.2.4",
    5457                "uglify-js": "^3.4.9",
    5558                "uglifyjs-webpack-plugin": "2.1.1",
     59                "wait-on": "3.3.0",
    5660                "webpack": "4.29.2",
    5761                "webpack-dev-server": "3.1.14",
    5862                "webpack-livereload-plugin": "2.2.0"
     
    123127                "test": "grunt test",
    124128                "watch": "grunt watch",
    125129                "grunt": "grunt",
    126                 "env:start": "./tools/local-env/start.sh",
    127                 "env:reset-site": "./tools/local-env/install-wordpress.sh --reset-site",
    128                 "test:e2e": "wp-scripts test-e2e --config tests/e2e/jest.config.js"
     130
     131                "docker:start": "docker-compose -f ./tools/local-env/docker-compose.yml up -d",
     132                "docker:stop": "docker-compose -f ./tools/local-env/docker-compose.yml down",
     133
     134                "env:start": "dotenv npm run docker:start",
     135                "env:stop": "dotenv npm run docker:stop",
     136
     137                "env:install": "dotenv npm run env:install-next",
     138                "env:install-next": "npm run env:install-config && npm run env:reset-site && npm run env:install-site",
     139                "env:install-config": "npm run env:cli config create -- --dbname=wordpress_develop --dbuser=root --dbpass=password --dbhost=mysql --force",
     140                "env:install-site": "cross-var wait-on tcp:localhost:$LOCAL_PORT && npm run env:cli core install -- --title=WPDEV --admin_user=admin --admin_password=password --admin_email=test@test.com --skip-email --url=http://localhost:$LOCAL_PORT --quiet",
     141                "env:reset-site": "cross-var wait-on tcp:localhost:$LOCAL_PORT && npm run env:cli db reset -- --yes --quiet",
     142
     143                "env:cli": "docker-compose -f ./tools/local-env/docker-compose.yml -f ./tools/local-env/docker-compose.scripts.yml run --rm cli",
     144
     145                "test:e2e": "dotenv npm run test:e2e-next",
     146                "test:e2e-next": "cross-var cross-env WP_BASE_URL=http://localhost:$LOCAL_PORT wp-scripts test-e2e --config tests/e2e/jest.config.js"
    129147        }
    130148}
  • new file tools/local-env/default.template

    diff --git a/tools/local-env/default.template b/tools/local-env/default.template
    new file mode 100644
    index 0000000000..e0a161926b
    - +  
     1server {
     2        index index.php index.html;
     3
     4        listen 80 default_server;
     5        listen [::]:80 default_server;
     6
     7        server_name localhost;
     8
     9        client_max_body_size 1g;
     10
     11        error_log  /var/log/nginx/error.log;
     12        access_log /var/log/nginx/access.log;
     13
     14        root /var/www/${LOCAL_DIR};
     15
     16        location / {
     17                try_files $uri $uri/ /index.php?$args;
     18        }
     19
     20        location ~ \.php$ {
     21                try_files $uri =404;
     22                fastcgi_split_path_info ^(.+\.php)(/.+)$;
     23                fastcgi_pass php:9000;
     24                fastcgi_index index.php;
     25                include fastcgi_params;
     26                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
     27                fastcgi_param PATH_INFO $fastcgi_path_info;
     28        }
     29}
  • new 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
    new file mode 100644
    index 0000000000..2ebc076153
    - +  
     1version: '3.7'
     2
     3services:
     4  cli:
     5    image: garypendergast/wordpress-develop-cli
     6    volumes:
     7      - '../../:/var/www'
     8
     9  phpunit:
     10    image: garypendergast/wordpress-develop-phpunit
     11    volumes:
     12      - './phpunit-config.ini:/usr/local/etc/php/conf.d/phpunit-config.ini'
     13      - '../../:/wordpress-develop'
     14    init: true
     15
     16volumes:
     17  phpunit-uploads: {}
  • tools/local-env/docker-compose.yml

    diff --git a/tools/local-env/docker-compose.yml b/tools/local-env/docker-compose.yml
    index 7af351759c..6d8ed18175 100644
    a b  
    1 version: '3.1'
     1version: '3.7'
    22
    33services:
    4   wordpress:
    5     image: wordpress
    6     restart: always
     4  wordpress-develop:
     5    image: 'nginx:alpine'
    76    ports:
    8       - 8889:80
     7      - '${LOCAL_PORT-8889}:80'
    98    environment:
    10       WORDPRESS_DB_HOST: mysql
    11       WORDPRESS_DB_PASSWORD: example
    12       ABSPATH: /usr/src/wordpress/
    13       WORDPRESS_DEBUG: 1
    14       WORDPRESS_CONFIG_EXTRA: |
    15         define( 'SCRIPT_DEBUG', true );
     9      LOCAL_DIR: '${LOCAL_DIR-src}'
     10    command: /bin/sh -c "envsubst '$$LOCAL_DIR' < /etc/nginx/conf.d/default.template > /etc/nginx/conf.d/default.conf && exec nginx -g 'daemon off;'"
    1611    volumes:
    17       - wordpress_data:/var/www/html
    18       - ../../build/:/var/www/html/
    19     depends_on:
    20       - mysql
     12      - './default.template:/etc/nginx/conf.d/default.template'
     13      - '../../:/var/www'
     14    links:
     15      - php
    2116
    22   cli:
    23     image: wordpress:cli
    24     restart: always
    25     user: xfs
     17  php:
     18    image: garypendergast/wordpress-develop-php
    2619    volumes:
    27       - wordpress_data:/var/www/html
    28       - ../../build/:/var/www/html/
    29     depends_on:
     20      - './php-config.ini:/usr/local/etc/php/conf.d/php-config.ini'
     21      - '../../:/var/www'
     22    links:
    3023      - mysql
    31       - wordpress
    3224
    3325  mysql:
    34     image: mysql:5.7
    35     restart: always
     26    image: 'mysql:5.7'
    3627    environment:
    37       MYSQL_ROOT_PASSWORD: example
    38       MYSQL_DATABASE: wordpress_test
     28      MYSQL_ROOT_PASSWORD: password
     29      MYSQL_DATABASE: wordpress_develop
     30    healthcheck:
     31      test: CMD mysql -e "SHOW TABLES FROM wordpress_develop" -uroot -ppassword -hmysql --protocol=tcp
     32      interval: 1s
     33      retries: '100'
     34    volumes:
     35      - 'mysql:/var/lib/mysql'
    3936
    4037volumes:
    41   wordpress_data:
     38  mysql: {}
  • deleted file tools/local-env/includes.sh

    diff --git a/tools/local-env/includes.sh b/tools/local-env/includes.sh
    deleted file mode 100755
    index d0028a1c66..0000000000
    + -  
    1 #!/bin/bash
    2 
    3 ##
    4 # Ask a Yes/No question, and way for a reply.
    5 #
    6 # This is a general-purpose function to ask Yes/No questions in Bash, either with or without a default
    7 # answer. It keeps repeating the question until it gets a valid answer.
    8 #
    9 # @param {string} prompt    The question to ask the user.
    10 # @param {string} [default] Optional. "Y" or "N", for the default option to use if none is entered.
    11 # @param {int}    [timeout] Optional. The number of seconds to wait before using the default option.
    12 #
    13 # @returns {bool} true if the user replies Yes, false if the user replies No.
    14 ##
    15 ask() {
    16     # Source: https://djm.me/ask
    17     local timeout endtime timediff prompt default reply
    18 
    19     while true; do
    20 
    21                 timeout="${3:-}"
    22 
    23         if [ "${2:-}" = "Y" ]; then
    24             prompt="Y/n"
    25             default=Y
    26         elif [ "${2:-}" = "N" ]; then
    27             prompt="y/N"
    28             default=N
    29         else
    30             prompt="y/n"
    31             default=
    32                         timeout=
    33         fi
    34 
    35                 if [ -z "$timeout" ]; then
    36                 # Ask the question (not using "read -p" as it uses stderr not stdout)
    37                 echo -en "$1 [$prompt] "
    38 
    39                 # Read the answer (use /dev/tty in case stdin is redirected from somewhere else)
    40                 read reply </dev/tty
    41                 else
    42                         endtime=$((`date +%s` + $timeout));
    43                         while [ "$endtime" -ge `date +%s` ]; do
    44                                 timediff=$(($endtime - `date +%s`))
    45 
    46                                 echo -en "\r$1 [$prompt] (Default $default in ${timediff}s) "
    47                                 read -t 1 reply </dev/tty
    48 
    49                                 if [ -n "$reply" ]; then
    50                                         break
    51                                 fi
    52                         done
    53                 fi
    54 
    55         # Default?
    56         if [ -z "$reply" ]; then
    57             reply=$default
    58         fi
    59 
    60         # Check if the reply is valid
    61         case "$reply" in
    62             Y*|y*) return 0 ;;
    63             N*|n*) return 1 ;;
    64         esac
    65 
    66     done
    67 }
    68 
    69 ##
    70 # Download from a remote source.
    71 #
    72 # Checks for the existence of curl and wget, then downloads the remote file using the first available option.
    73 #
    74 # @param {string} remote  The remote file to download.
    75 # @param {string} [local] Optional. The local filename to use. If it isn't passed, STDOUT is used.
    76 #
    77 # @return {bool} Whether the download succeeded or not.
    78 ##
    79 download() {
    80     if command_exists "curl"; then
    81         curl -s -o "${2:--}" "$1"
    82     elif command_exists "wget"; then
    83                 wget -nv -O "${2:--}" "$1"
    84     fi
    85 }
    86 
    87 ##
    88 # Add error message formatting to a string, and echo it.
    89 #
    90 # @param {string} message The string to add formatting to.
    91 ##
    92 error_message() {
    93         echo -en "\033[31mERROR\033[0m: $1"
    94 }
    95 
    96 ##
    97 # Add warning message formatting to a string, and echo it.
    98 #
    99 # @param {string} message The string to add formatting to.
    100 ##
    101 warning_message() {
    102         echo -en "\033[33mWARNING\033[0m: $1"
    103 }
    104 
    105 ##
    106 # Add status message formatting to a string, and echo it.
    107 #
    108 # @param {string} message The string to add formatting to.
    109 ##
    110 status_message() {
    111         echo -en "\033[32mSTATUS\033[0m: $1"
    112 }
    113 
    114 ##
    115 # Add formatting to an action string.
    116 #
    117 # @param {string} message The string to add formatting to.
    118 ##
    119 action_format() {
    120         echo -en "\033[32m$1\033[0m"
    121 }
    122 
    123 ##
    124 # Check if the command exists as some sort of executable.
    125 #
    126 # The executable form of the command could be an alias, function, builtin, executable file or shell keyword.
    127 #
    128 # @param {string} command The command to check.
    129 #
    130 # @return {bool} Whether the command exists or not.
    131 ##
    132 command_exists() {
    133         type -t "$1" >/dev/null 2>&1
    134 }
  • deleted file tools/local-env/install-node-nvm.sh

    diff --git a/tools/local-env/install-node-nvm.sh b/tools/local-env/install-node-nvm.sh
    deleted file mode 100755
    index f4c29240ce..0000000000
    + -  
    1 #!/bin/bash
    2 NVM_VERSION=`curl -Ls -w %{url_effective} -o /dev/null https://github.com/nvm-sh/nvm/releases/latest | rev | cut -d '/' -f 1 | rev`
    3 
    4 # Exit if any command fails
    5 set -e
    6 
    7 # Include useful functions
    8 . "$(dirname "$0")/includes.sh"
    9 
    10 # Load NVM
    11 if [ -n "$NVM_DIR" ]; then
    12         # The --no-use option ensures loading NVM doesn't switch the current version.
    13         if [ -f "$NVM_DIR/nvm.sh" ]; then
    14                 . "$NVM_DIR/nvm.sh" --no-use
    15         elif command_exists "brew" && [ -f "$(brew --prefix nvm)/nvm.sh" ]; then
    16                 # use homebrew if that's how nvm was installed
    17                 . "$(brew --prefix nvm)/nvm.sh" --no-use
    18         fi
    19 fi
    20 
    21 # Change to the expected directory
    22 cd "$(dirname "$0")/../.."
    23 
    24 # Check if nvm is installed
    25 if [ "$TRAVIS" != "true" ] && ! command_exists "nvm"; then
    26         if ask "$(error_message "NVM isn't installed, would you like to download and install it automatically?")" Y; then
    27                 # The .bash_profile file needs to exist for NVM to install
    28                 if [ ! -e ~/.bash_profile ]; then
    29                         touch ~/.bash_profile
    30                 fi
    31 
    32                 echo -en $(status_message "Installing NVM..." )
    33                 download "https://raw.githubusercontent.com/nvm-sh/nvm/$NVM_VERSION/install.sh" | bash >/dev/null 2>&1
    34                 echo ' done!'
    35 
    36                 echo -e $(warning_message "NVM was updated, please run this command to reload it:" )
    37                 echo -e $(warning_message "$(action_format ". \$HOME/.nvm/nvm.sh")" )
    38                 echo -e $(warning_message "After that, re-run the setup script to continue." )
    39         else
    40                 echo -e $(error_message "")
    41                 echo -e $(error_message "Please install NVM manually, then re-run the setup script to continue.")
    42                 echo -e $(error_message "NVM installation instructions can be found here: $(action_format "https://github.com/nvm-sh/nvm")")
    43         fi
    44 
    45         exit 1
    46 fi
    47 
    48 # Check if the current nvm version is up to date.
    49 if [ "$TRAVIS" != "true" ] && [ $NVM_VERSION != "v$(nvm --version)" ]; then
    50         echo -en $(status_message "Updating NVM..." )
    51         download "https://raw.githubusercontent.com/nvm-sh/nvm/$NVM_VERSION/install.sh" | bash >/dev/null 2>&1
    52         echo ' done!'
    53 
    54         echo -e $(warning_message "NVM was updated, please run this command to reload it:" )
    55         echo -e $(warning_message "$(action_format ". \$HOME/.nvm/nvm.sh")" )
    56         echo -e $(warning_message "After that, re-run the setup script to continue." )
    57         exit 1
    58 fi
    59 
    60 # Check if the current node version is up to date.
    61 if [ "$TRAVIS" != "true" ] && [ "$(nvm current)" != "$(nvm version-remote --lts)" ]; then
    62         echo -e $(warning_message "Node version does not match the latest long term support version. Please run this command to install and use it:" )
    63         echo -e $(warning_message "$(action_format "nvm install")" )
    64         echo -e $(warning_message "After that, re-run the setup script to continue." )
    65         exit 1
    66 fi
    67 
    68 # Install/update packages
    69 echo -e $(status_message "Installing and updating NPM packages..." )
    70 npm install
    71 
    72 # Make sure npm is up-to-date
    73 npm install npm -g
    74 
    75 # There was a bug in NPM that caused changes in package-lock.json. Handle that.
    76 if [ "$TRAVIS" != "true" ] && ! git diff --no-ext-diff --exit-code package-lock.json >/dev/null; then
    77         if ask "$(warning_message "Your package-lock.json changed, which may mean there's an issue with your NPM cache. Would you like to try and automatically clean it up?" )" N 10; then
    78                 rm -rf node_modules/
    79                 npm cache clean --force >/dev/null 2>&1
    80                 git checkout package-lock.json
    81 
    82                 echo -e $(status_message "Reinstalling NPM packages..." )
    83                 npm install
    84 
    85                 # Check that it's cleaned up now.
    86                 if git diff --no-ext-diff --exit-code package-lock.json >/dev/null; then
    87                         echo -e $(warning_message "Confirmed that the NPM cache is cleaned up." )
    88                 else
    89                         echo -e $(error_message "We were unable to clean the NPM cache, please manually review the changes to package-lock.json. Continuing with the setup process..." )
    90                 fi
    91         else
    92                 echo -e $(warning_message "Please manually review the changes to package-lock.json. Continuing with the setup process..." )
    93         fi
    94 fi
  • deleted file tools/local-env/install-wordpress.sh

    diff --git a/tools/local-env/install-wordpress.sh b/tools/local-env/install-wordpress.sh
    deleted file mode 100755
    index c05542bda7..0000000000
    + -  
    1 #!/bin/bash
    2 
    3 # Exit if any command fails.
    4 set -e
    5 
    6 # Common variables.
    7 DOCKER_COMPOSE_FILE_OPTIONS="-f $(dirname "$0")/docker-compose.yml"
    8 WP_DEBUG=${WP_DEBUG-true}
    9 SCRIPT_DEBUG=${SCRIPT_DEBUG-true}
    10 
    11 # Gutenberg script includes.
    12 . "$(dirname "$0")/includes.sh"
    13 
    14 # These are the containers and values for the development site.
    15 CLI='cli'
    16 CONTAINER='wordpress'
    17 SITE_TITLE='WordPress Dev'
    18 
    19 # Get the host port for the WordPress container.
    20 HOST_PORT=$(docker-compose $DOCKER_COMPOSE_FILE_OPTIONS port $CONTAINER 80 | awk -F : '{printf $2}')
    21 
    22 # Wait until the Docker containers are running and the WordPress site is
    23 # responding to requests.
    24 echo -en $(status_message "Attempting to connect to WordPress...")
    25 until $(curl -L http://localhost:$HOST_PORT -so - 2>&1 | grep -q "WordPress"); do
    26     echo -n '.'
    27     sleep 5
    28 done
    29 echo ''
    30 
    31 # If this is the test site, we reset the database so no posts/comments/etc.
    32 # dirty up the tests.
    33 if [ "$1" == '--reset-site' ]; then
    34         echo -e $(status_message "Resetting test database...")
    35         docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run --rm -u 33 $CLI db reset --yes --quiet
    36 fi
    37 
    38 # Install WordPress.
    39 echo -e $(status_message "Installing WordPress...")
    40 # The `-u 33` flag tells Docker to run the command as a particular user and
    41 # prevents permissions errors. See: https://github.com/WordPress/gutenberg/pull/8427#issuecomment-410232369
    42 docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run --rm -u 33 $CLI core install --title="$SITE_TITLE" --admin_user=admin --admin_password=password --admin_email=test@test.com --skip-email --url=http://localhost:$HOST_PORT --quiet
    43 
    44 if [ "$E2E_ROLE" = "author" ]; then
    45         echo -e $(status_message "Creating an additional author user for testing...")
    46         # Create an additional author user for testing.
    47         docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run --rm -u 33 $CLI user create author author@example.com --role=author --user_pass=authpass --quiet
    48         # Assign the existing Hello World post to the author.
    49         docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run --rm -u 33 $CLI post update 1 --post_author=2 --quiet
    50 fi
    51 
    52 CURRENT_WP_VERSION=$(docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run -T --rm $CLI core version)
    53 echo -e $(status_message "Current WordPress version: $CURRENT_WP_VERSION...")
    54 
    55 if [ "$WP_VERSION" == "latest" ]; then
    56         # Check for WordPress updates, to make sure we're running the very latest version.
    57         echo -e $(status_message "Updating WordPress to the latest version...")
    58         docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run --rm -u 33 $CLI core update --quiet
    59         echo -e $(status_message "Updating The WordPress Database...")
    60         docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run --rm -u 33 $CLI core update-db --quiet
    61 fi
    62 
    63 # If the 'wordpress' volume wasn't during the down/up earlier, but the post port has changed, we need to update it.
    64 echo -e $(status_message "Checking the site's url...")
    65 CURRENT_URL=$(docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run -T --rm $CLI option get siteurl)
    66 if [ "$CURRENT_URL" != "http://localhost:$HOST_PORT" ]; then
    67         docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run --rm -u 33 $CLI option update home "http://localhost:$HOST_PORT" --quiet
    68         docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run --rm -u 33 $CLI option update siteurl "http://localhost:$HOST_PORT" --quiet
    69 fi
    70 
    71 # Install a dummy favicon to avoid 404 errors.
    72 echo -e $(status_message "Installing a dummy favicon...")
    73 docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run --rm $CONTAINER touch /var/www/html/favicon.ico
    74 
    75 # Configure site constants.
    76 echo -e $(status_message "Configuring site constants...")
    77 WP_DEBUG_CURRENT=$(docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run -T --rm -u 33 $CLI config get --type=constant --format=json WP_DEBUG)
    78 if [ $WP_DEBUG != $WP_DEBUG_CURRENT ]; then
    79         docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run --rm -u 33 $CLI config set WP_DEBUG $WP_DEBUG --raw --type=constant --quiet
    80         WP_DEBUG_RESULT=$(docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run -T --rm -u 33 $CLI config get --type=constant --format=json WP_DEBUG)
    81         echo -e $(status_message "WP_DEBUG: $WP_DEBUG_RESULT...")
    82 fi
    83 SCRIPT_DEBUG_CURRENT=$(docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run -T --rm -u 33 $CLI config get --type=constant --format=json SCRIPT_DEBUG)
    84 if [ $SCRIPT_DEBUG != $SCRIPT_DEBUG_CURRENT ]; then
    85         docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run --rm -u 33 $CLI config set SCRIPT_DEBUG $SCRIPT_DEBUG --raw --type=constant --quiet
    86         SCRIPT_DEBUG_RESULT=$(docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run -T --rm -u 33 $CLI config get --type=constant --format=json SCRIPT_DEBUG)
    87         echo -e $(status_message "SCRIPT_DEBUG: $SCRIPT_DEBUG_RESULT...")
    88 fi
  • deleted file tools/local-env/launch-containers.sh

    diff --git a/tools/local-env/launch-containers.sh b/tools/local-env/launch-containers.sh
    deleted file mode 100755
    index 412386c495..0000000000
    + -  
    1 #!/bin/bash
    2 
    3 # Exit if any command fails.
    4 set -e
    5 
    6 # Common variables.
    7 DOCKER_COMPOSE_FILE_OPTIONS="-f $(dirname "$0")/docker-compose.yml"
    8 
    9 # Include useful functions.
    10 . "$(dirname "$0")/includes.sh"
    11 
    12 # Check that Docker is installed.
    13 if ! command_exists "docker"; then
    14         echo -e $(error_message "Docker doesn't seem to be installed. Please head on over to the Docker site to download it: $(action_format "https://www.docker.com/products/docker-desktop")")
    15         exit 1
    16 fi
    17 
    18 # Check that Docker is running.
    19 if ! docker info >/dev/null 2>&1; then
    20         echo -e $(error_message "Docker isn't running. Please check that you've started your Docker app, and see it in your system tray.")
    21         exit 1
    22 fi
    23 
    24 # Stop existing containers.
    25 echo -e $(status_message "Stopping Docker containers...")
    26 docker-compose $DOCKER_COMPOSE_FILE_OPTIONS down --remove-orphans >/dev/null
    27 
    28 # Download image updates.
    29 echo -e $(status_message "Downloading Docker image updates...")
    30 docker-compose $DOCKER_COMPOSE_FILE_OPTIONS pull
    31 
    32 # Launch the containers.
    33 echo -e $(status_message "Starting Docker containers...")
    34 docker-compose $DOCKER_COMPOSE_FILE_OPTIONS up -d >/dev/null
  • new file tools/local-env/php-config.ini

    diff --git a/tools/local-env/php-config.ini b/tools/local-env/php-config.ini
    new file mode 100644
    index 0000000000..1f385e924c
    - +  
     1upload_max_filesize = 1G
     2post_max_size = 1G
  • new file tools/local-env/phpunit-config.ini

    diff --git a/tools/local-env/phpunit-config.ini b/tools/local-env/phpunit-config.ini
    new file mode 100644
    index 0000000000..bf4788b33d
    - +  
     1upload_max_filesize = 1G
     2post_max_size = 1G
     3
     4opcache.enable = 1
     5opcache.enable_cli = 1
     6opache.file_cache = /tmp/php-opcache
  • deleted file tools/local-env/start.sh

    diff --git a/tools/local-env/start.sh b/tools/local-env/start.sh
    deleted file mode 100755
    index 8d92b0db51..0000000000
    + -  
    1 #!/bin/bash
    2 
    3 # Exit if any command fails
    4 set -e
    5 
    6 # Include useful functions
    7 . "$(dirname "$0")/includes.sh"
    8 
    9 # Change to the expected directory
    10 cd "$(dirname "$0")/../../"
    11 
    12 # Check Node and NVM are installed
    13 . "$(dirname "$0")/install-node-nvm.sh"
    14 
    15 # Check Docker is installed and running and launch the containers
    16 . "$(dirname "$0")/launch-containers.sh"
    17 
    18 # Set up WordPress Development site.
    19 # Note: we don't bother installing the test site right now, because that's
    20 # done on every time `npm run test-e2e` is run.
    21 . "$(dirname "$0")/install-wordpress.sh"
    22 
    23 ! read -d '' WORDPRESS <<"EOT"
    24                    `-/+osssssssssssso+/-`
    25                ./oys+:.`            `.:+syo/.
    26             .+ys:.   .:/osyyhhhhyyso/:.   ./sy+.
    27           /ys:   -+ydmmmmmmmmmmmmmmmmmmdy+-   :sy/
    28         /h+`  -odmmmmmmmmmmmmmmmmmmmmmmmmmmdo-  `+h/
    29       :ho`  /hmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmds/   `oh:
    30     `sy.  /hmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmd+        .ys`
    31    .ho  `sdddhhhyhmmmdyyhhhdddddhhhyydmmmmy           oh.
    32   .h+          ``-dmmy.``         ``.ymmmmh            +h.
    33  `ho  `       /mmmmmmmmmmo       .dmmmmmmmms        ~~  oh`
    34  oy  .h`       ymmmmmmmmmm:       /mmmmmmmmmy`      -d.  yo
    35 .d-  ymy       `dmmmmmmmmmd.       ymmmmmmmmmh`     /my  -d.
    36 oy  -mmm+       /mmmmmmmmmmy       .dmmmmmmmmmy     ymm-  yo
    37 h+  +mmmd-       smmmmmmmmmm+       /mmmmmmmmmm-   :mmm+  +h
    38 d/  smmmmh`      `dmmmmmmmmmd`       smmmmmmmmm:  `dmmms  /d
    39 d/  smmmmms       :mmmmmmmmm+        `dmmmmmmmd.  smmmms  /d
    40 h+  +mmmmmm/       smmmmmmmh  +       /mmmmmmmy  /mmmmm+  +h
    41 oy  -mmmmmmd.      `dmmmmmd- +m/       smmmmmd. .dmmmmm-  yo
    42 .d-  ymmmmmmh       :mmmmm+ .dmd-      `dmmmm/  ymmmmmy  -d.
    43  oy  .dmmmmmmo       smmmh  hmmmh`      :mmmy  +mmmmmd.  yo
    44  `ho  -dmmmmmd:      `dmd- ommmmms       smd- .dmmmmd-  oh`
    45   .h+  -dmmmmmd`      :m+ -dmmmmmm:      `do  hmmmmd-  +h.
    46    .ho  .ymmmmmy       + `hmmmmmmmd.      :` ommmmy.  oh.
    47     `sy.  /hmmmm+        ommmmmmmmmy        -dmmh/  .ys`
    48       :ho`  /hmmd-      :mmmmmmmmmmmo      `hmh/  `oh:
    49         /h+`  -odh`    `dmmmmmmmmmmmd:     oo-  `+h/
    50           /ys:   ~~    smmmmmmmmmmmmmd`       :sy/
    51             .+ys/.    `/osyyhhhhyyso/:`   ./sy+.
    52                ./oys+:.`            `.:+syo/.
    53                    `-/+osssssssssssso+/-`
    54 EOT
    55 
    56 CURRENT_URL=$(docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run -T --rm cli option get siteurl)
    57 
    58 echo -e "\nWelcome to...\n"
    59 echo -e "\033[95m$WORDPRESS\033[0m"
    60 
    61 # Give the user more context to what they should do next: Run the environment and start testing!
    62 echo -e "\nOpen $(action_format "$CURRENT_URL") to get started!"
    63 
    64 echo -e "\n\nAccess the above install using the following credentials:"
    65 echo -e "Default username: $(action_format "admin"), password: $(action_format "password")"