Skip to content

Commit 300a9e0

Browse files
doc(developer): Update to use ddev add-ons
1 parent 65300ee commit 300a9e0

File tree

1 file changed

+27
-29
lines changed

1 file changed

+27
-29
lines changed

docs/DEVELOPER.md

Lines changed: 27 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -65,53 +65,48 @@ wp-sources (choose the name you want for this folder)
6565
6666
│ (WordPress sources)
6767
68-
└───.ddev (do not change this folder name)
68+
└───.ddev
6969
│ │
70-
│ │ (Cloned sources of a specific WordPress ddev repo)
70+
│ │ (DDEV files)
7171
72-
└───my-own-modules (do not change this folder name)
72+
└───wp-content/plugins
7373
7474
75-
└───crowdsec-bouncer (do not change this folder name)
75+
└───crowdsec (do not change this folder name)
7676
7777
│ (Sources of a this module)
7878
7979
```
8080

8181
- Create an empty folder that will contain all necessary sources:
8282
```shell
83-
mkdir wp-sources
83+
mkdir wp-sources && cd wp-sources
8484
```
85-
- Create an empty `.ddev` folder for DDEV and clone our pre-configured DDEV repo:
85+
- Create a DDEV WordPress project with some DDEV add-ons
8686

8787
```shell
88-
mkdir wp-sources/.ddev && cd wp-sources/.ddev && git clone git@github.com:julienloizelet/ddev-wp.git ./
88+
ddev config --project-type=wordpress --project-name=your-project-name
89+
ddev get ddev/ddev-redis
90+
ddev get ddev/ddev-memcached
91+
ddev get julienloizelet/ddev-tools
92+
ddev get julienloizelet/ddev-playwright
93+
ddev start
8994
```
90-
- Copy some configurations file:
9195

92-
```shell
93-
cp .ddev/config_overrides/config.wp59.yaml .ddev/config.wp59.yaml
94-
cp .ddev/config_overrides/config.crowdsec.yaml .ddev/config.crowdsec.yaml
95-
```
9696
- Launch DDEV
9797

9898
```shell
99-
cd .ddev && ddev start
99+
ddev start
100100
```
101101
This should take some times on the first launch as this will download all necessary docker images.
102102

103103

104104
### WordPress installation
105105

106106
```
107-
cd wp-sources
108-
wget https://wordpress.org/wordpress-5.9.tar.gz
109-
tar -xf wordpress-5.9.tar.gz wordpress
110-
cp -r wordpress/. ./
111-
rm -rf wordpress
112-
rm wordpress-5.9.tar.gz
113-
ddev start
114-
ddev exec wp core install --url='https://wp59.ddev.site' --title='WordPress' --admin_user='admin'
107+
ddev wp core download
108+
109+
ddev exec wp core install --url='https://your-project-name.ddev.site' --title='WordPress' --admin_user='admin'
115110
--admin_password='admin123' --admin_email='admin@admin.com'
116111
117112
```
@@ -124,19 +119,22 @@ ddev exec wp core install --url='https://wp59.ddev.site' --title='WordPress' --a
124119
##### Install the module
125120

126121
```shell
127-
cd wp-sources
128-
mkdir my-own-modules && mkdir my-own-modules/crowdsec-bouncer && cd my-own-modules/crowdsec-bouncer
122+
mkdir -p wp-content/plugins/crowdsec && cd wp-content/plugins/crowdsec
123+
129124
git clone git@github.com:crowdsecurity/cs-wordpress-bouncer.git ./
130-
cd wp-sources
131-
cp .ddev/additional_docker_compose/docker-compose.crowdsec.yaml .ddev/docker-compose.crowdsec.yaml
132-
cp .ddev/additional_docker_compose/docker-compose.playwright.yaml .ddev/docker-compose.playwright.yaml
133-
ddev start
134125
```
135126

136-
Login to the admin by browsing the url `https://wp59.ddev.site/admin` (username: `admin` and password: `admin123`)
127+
Login to the admin by browsing the url `https://your-project-name.ddev.site/admin` (username: `admin` and password: `admin123`)
137128

138129
Activate the CrowdSec plugin.
139130

131+
Add some Crowdsec tools and restart:
132+
133+
```
134+
ddev get julienloizelet/ddev-crowdsec-php
135+
ddev restart
136+
```
137+
140138
##### End-to-end tests
141139

142140
We are using a Jest/Playwright Node.js stack to launch a suite of end-to-end tests.
@@ -160,7 +158,7 @@ cp .ddev/okaeli-add-on/wordpress/custom_files/crowdsec/php/cache-actions-from-p
160158
Then, ensure that `run-tests.sh` and `test-init.sh` files are executable.
161159

162160
```shell
163-
cd wp-sources/my-own-module/crowdsec-bouncer/tests/e2e-ddev/__scripts__
161+
cd wp-sources/wp-content/plugins/crowdsec/tests/e2e-ddev/__scripts__
164162
```
165163
Run `chmod +x run-tests.sh test-init.sh` if not.
166164

0 commit comments

Comments
 (0)