-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
73 lines (59 loc) · 2.41 KB
/
Makefile
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
jjj:
@ echo "There is no default task"
## Tests
test-e2e:
cd ./custom/dev-env && \
docker-compose exec -w "/project" test_php vendor/bin/codecept build && \
docker-compose exec -w "/project" test_php vendor/bin/codecept run acceptance
vnc:
# sudo apt-get -y install tigervnc-common xtightvncviewer
# vncpasswd ./tests/.vnc-passwd
# password is "secret" (default for Selenium docker-images)
vncviewer -passwd ./tests/.vnc-passwd localhost::5900 &
dev-env--shell-test:
cd ./custom/dev-env && docker-compose exec test_php bash
## Development environment (dev-env)
### Setup
dev-env--up:
make wp-core-download
make dev-env--download
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.8.3 [email protected]:WordPress/WordPress.git ./custom/wp-core
rm -rf ./custom/wp-core/.git
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 -- [email protected]: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 && \
make wp 'core install --url="http://in.docker.local:8000/" --title="Dev site" --admin_user="admin" --admin_password="admin" --admin_email="[email protected]" --skip-email' && \
make wp 'plugin activate recrawler' && \
make wp "rewrite structure '/%postname%/'" && \
\
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://test.in.docker.local:8000/" --title="Testing site" --admin_user="admin" --admin_password="admin" --admin_email="[email protected]" --skip-email && \
docker-compose exec test_php wp plugin activate recrawler && \
docker-compose exec test_php wp rewrite structure '/%postname%/'
### 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--shell:
cd ./custom/dev-env && make shell