-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
106 lines (82 loc) · 3.11 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
jjj:
@ echo "There is no default task"
front.watch:
npm ci
npx webpack --mode=development --watch --progress
front.build:
npm ci
npx webpack --mode=production
release:
make front.build
mkdir -p ./dist
rm -rf ./dist/*
mkdir -p ./dist/entity-viewer
cp -r ./assets ./dist/entity-viewer/
cp ./package.json ./dist/entity-viewer/
cp ./package-lock.json ./dist/entity-viewer/
cp ./webpack.config.js ./dist/entity-viewer/
cp ./readme.txt ./dist/entity-viewer/
cp ./LICENSE ./dist/entity-viewer/
cp ./entity-viewer.php ./dist/entity-viewer/
cp -r ./src ./dist/entity-viewer/
cd ./dist && zip -r entity-viewer.zip entity-viewer
## 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
# vncpasswd ./tests/e2e/.vnc-passwd
# password is "secret" (default for Selenium docker-images)
vncviewer -passwd ./tests/e2e/.vnc-passwd localhost::5900 &
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 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=6.6.2 [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 6.0.16 --depth=1 -- [email protected]:wodby/docker4wordpress.git . && \
rm ./compose.override.yml && \
cp ../../tools/dev-env/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://ev.docker.local:8000/" --title="Dev site" --admin_user="admin" --admin_password="admin" --admin_email="[email protected]" --skip-email' && \
make wp 'plugin activate entity-viewer' && \
make wp 'ev test-data remove' && make wp 'ev test-data generate' && \
\
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.ev.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 entity-viewer && \
docker compose exec test_php wp ev test-data remove && \
docker compose exec test_php wp ev test-data generate
### 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