forked from Automattic/wp-super-cache
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
62 lines (44 loc) · 1.86 KB
/
Makefile
File metadata and controls
62 lines (44 loc) · 1.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
.DEFAULT_GOAL := help
SHELL := /bin/bash
PLUGIN_NAME := wp-super-cache
WP_ENV := COMPOSE_PROJECT_NAME=$(PLUGIN_NAME) npx --yes @wordpress/env
## Development environment
install: ## Install PHP (Composer) and JS (npm) dependencies
composer install
npm install
up: ## Start WordPress in Docker (http://localhost:8888, admin/password)
$(WP_ENV) start
down: ## Stop the WordPress containers
$(WP_ENV) stop
destroy: ## Remove the WordPress containers and database
$(WP_ENV) destroy
logs: ## Tail the WordPress container logs
$(WP_ENV) logs
cli: ## Open a shell inside the cli container
$(WP_ENV) run cli bash
wp: ## Run an arbitrary wp-cli command, e.g. `make wp CMD="plugin list"`
$(WP_ENV) run cli wp $(CMD)
## Test content
seed: ## Create 100 randomly named posts and 100 pages for cache testing
$(WP_ENV) run cli wp eval-file wp-content/plugins/wp-super-cache/tests/dev/seed.php
unseed: ## Delete content created by `make seed`
$(WP_ENV) run cli wp eval-file wp-content/plugins/wp-super-cache/tests/dev/unseed.php
## Lint
lint: ## Run PHP CodeSniffer
composer lint
lint-all: ## Run PHP CodeSniffer on all files
composer phpcs
lint-fix: ## Auto-fix PHP CodeSniffer issues
composer lint-fix
## Release
pre-build: ## Prepare a release PR. Usage: make pre-build VERSION=x.y.z
@test -n "$(VERSION)" || { echo "Usage: make pre-build VERSION=x.y.z"; exit 1; }
./scripts/pre-build.sh $(VERSION)
build: ## Build build/wp-super-cache.zip (run pre-build and merge the PR first)
./scripts/build-plugin.sh
publish: ## Create a GitHub release from readme.txt + build/wp-super-cache.zip
./scripts/publish.sh
## Help
help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-12s\033[0m %s\n", $$1, $$2}'
.PHONY: install up down destroy logs cli wp seed unseed lint lint-all lint-fix pre-build build publish help