Add dockers docs and yarn commands

This commit is contained in:
Alex P 2021-08-19 17:49:54 +03:00
parent 869281d81f
commit 6aa0f17bca
2 changed files with 35 additions and 0 deletions

View file

@ -22,6 +22,28 @@ PayPal's latest complete payments processing solution. Accept PayPal, Pay Later,
2. `$ ./vendor/bin/phpunit`
3. `$ ./vendor/bin/phpcs`
### Docker
You can also use the Docker environment which includes WP, WC and all developments tools.
0. Install Docker and Docker Compose.
1. `$ cp .env.example .env` and edit the configuration in the `.env` file if needed.
2. `$ yarn run docker:build` (or copy the commands from [package.json](/package.json) if you do not have `yarn`).
3. `$ yarn docker:install`
4. `$ yarn docker:start`
5. Add `127.0.0.1 wc-pp.myhost` to your `hosts` file and open http://wc-pp.myhost (the default value of `WP_DOMAIN` in `.env`).
Tests and code style:
- `$ yarn run docker:test`
- `$ yarn run docker:lint`
After some changes in `.env` (such as PHP, WP versions) you may need to rebuild the Docker image:
1. `$ yarn run docker:destroy` (all data will be lost)
2. `$ yarn run docker:build`
See [package.json](/package.json) for other useful commands.
## Preparation for wordpress.org release
If you want to deploy a new version, you need to do some preparation:

View file

@ -14,6 +14,19 @@
"build:modules": "yarn run build:modules:ppcp-button && yarn build:modules:ppcp-wc-gateway",
"build:dev": "yarn run install:modules && yarn run build:modules",
"docker:build": "docker-compose build",
"docker:start": "docker-compose up -d wp_dev",
"docker:stop": "docker-compose down",
"docker:destroy": "docker-compose down -v",
"docker:logs": "docker-compose logs",
"docker:shell": "docker-compose run --rm wp_dev bash",
"docker:install": "docker-compose run --rm composer composer install && yarn run docker:build-js",
"docker:build-js": "docker-compose run --rm build yarn run build:dev",
"docker:composer-update": "docker-compose run --rm composer composer update",
"docker:test": "docker-compose run --rm test vendor/bin/phpunit",
"docker:lint": "docker-compose run --rm test vendor/bin/phpcs --parallel=8 -n -s",
"docker:fix-lint": "docker-compose run --rm test vendor/bin/phpcbf",
"prebuild": "rm -rf ./vendor",
"build": "composer install --no-dev && npm run build:dev && npm run archive",
"prearchive": "rm -rf $npm_package_name.zip",