This repository was archived by the owner on Feb 10, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
80 lines (65 loc) · 2.62 KB
/
Copy pathMakefile
File metadata and controls
80 lines (65 loc) · 2.62 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
@:
@ echo "No default task"
## Tests
test:
make test-wpunit
test-wpunit:
cd ./custom/dev-env && \
docker-compose exec -w "/project" test_php vendor/bin/phpunit
dev-env--shell-test:
cd ./custom/dev-env && docker-compose exec test_php bash
## Development environment
### Setup
dev-env--up:
# make wp-core-download
# make wp-tests-lib-download
make dev-env--download
composer install
cd ./custom/dev-env && make up
@ echo "\nWaiting for mysql..."
sleep 5
make dev-env--install
wp-core-download:
rm -rf ./custom/wp-core
git clone --depth=1 --branch=5.9.3 git@github.com:WordPress/WordPress.git ./custom/wp-core
rm -rf ./custom/wp-core/.git
wp-tests-lib-download:
mkdir -p ./custom
rm -rf ./custom/wp-tests-lib
svn co https://develop.svn.wordpress.org/tags/5.9.3/tests/phpunit/includes ./custom/wp-tests-lib/includes
svn co https://develop.svn.wordpress.org/tags/5.9.3/tests/phpunit/data ./custom/wp-tests-lib/data
svn co https://develop.svn.wordpress.org/tags/5.9.3/tests/phpunit/tests ./custom/wp-tests-lib/tests
dev-env--download:
rm -fr ./custom/dev-env && \
mkdir -p ./custom/dev-env && \
cd ./custom/dev-env && \
git clone -b 5.4.42 --depth=1 -- git@github.com:wodby/docker4wordpress.git . && \
rm ./docker-compose.override.yml && \
cp ../../tools/dev-env/docker-compose.yml . && \
cp ../../tools/dev-env/.env . && \
cp ../../tools/dev-env/wp-config.php ../wp-core/
dev-env--install:
cd ./custom/dev-env && \
docker-compose exec mariadb mysql -uroot -ppassword -e "GRANT FILE on *.* to 'wordpress'@'%';" && \
\
make wp 'core install --url="http://pomodoro.docker.local:8000/" --title="Dev site" --admin_user="admin" --admin_password="admin" --admin_email="admin@docker.local" --skip-email' && \
make wp 'language core install ru_RU --activate' && \
\
docker-compose exec mariadb mysql -uroot -ppassword -e "create database wordpress_test;" && \
docker-compose exec mariadb mysql -uroot -ppassword -e "GRANT ALL PRIVILEGES ON wordpress_test.* TO 'wordpress'@'%';" && \
docker-compose exec test_php wp core install --url="http://pomodoro.docker.local:8000/" --title="Testing site" --admin_user="admin" --admin_password="admin" --admin_email="admin@docker.local" --skip-email && \
docker-compose exec test_php wp language core install ru_RU --activate
### Regular commands
dev-env--start:
cd ./custom/dev-env && make start
dev-env--stop:
cd ./custom/dev-env && make stop
dev-env--prune:
cd ./custom/dev-env && make prune
dev-env--restart:
cd ./custom/dev-env && make stop
cd ./custom/dev-env && make start
dev-env--recreate:
make dev-env--prune && make dev-env--up
dev-env--shell:
cd ./custom/dev-env && make shell