Skip to content

Commit 04d3a10

Browse files
committed
ddev script for developer docs
1 parent 943e7ef commit 04d3a10

File tree

3 files changed

+80
-0
lines changed

3 files changed

+80
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.DS_Store
2+
.ddev
23
/generator/vendor
34
/generator/composer.phar
45
/app/vendor

README.md

+20
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,26 @@ locally by adding this to your `local.php`:
5252
define('DISABLE_INCLUDE', true);
5353
```
5454

55+
## Run a DDEV environment for Developer documentation
56+
57+
DDEV container for the Matomo Developer Documentation site
58+
59+
To start this on your local machine using ddev run the command below.
60+
61+
```bash
62+
bash ddev-developer-docs.sh
63+
```
64+
65+
The local DDEV url for this container will be https://devdocs.ddev.site/
66+
67+
### Rebuilding
68+
69+
If you want to completely clear the existing setup and start again the following command will reset everything
70+
71+
```bash
72+
ddev stop --unlist devdocs && rm -rf .ddev && bash ddev-developer-docs.sh
73+
```
74+
5575
## Automatic documentation generation (API-Reference)
5676

5777
### The first time

ddev-developer-docs.sh

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
#!/bin/bash
2+
3+
############################################################
4+
# Help #
5+
############################################################
6+
Help()
7+
{
8+
# Display Help
9+
echo "DDEV setup script for Developer Documentation"
10+
echo
11+
echo "Syntax: scriptTemplate [-w|h]"
12+
echo "options:"
13+
echo "a Audit for security vulnerability advisories"
14+
echo "h Print this Help."
15+
echo
16+
}
17+
18+
Audit()
19+
{
20+
ddev exec -d /var/www/html/app composer audit --locked 2> /dev/null
21+
}
22+
23+
while getopts ":b:ah" option; do
24+
case $option in
25+
a) # display security vulnerability advisories
26+
Audit
27+
exit;;
28+
h) # display Help
29+
Help
30+
exit;;
31+
esac
32+
done
33+
34+
# Setup ddev if it has not been done yet
35+
if test -d .ddev; then
36+
echo "DDEV already setup"
37+
else
38+
ddev config --project-name=devdocs --project-type=php --docroot="app/public" --php-version=8.2 \
39+
--webserver-type=apache-fpm --composer-version=2 --corepack-enable=false --xdebug-enabled=false
40+
fi
41+
42+
#cp ddev-config-local.php app/config/local.php
43+
44+
ddev start
45+
ddev exec -d /var/www/html/app composer install
46+
if test -d app/tmp/cache; then
47+
echo "Cache directory already created"
48+
else
49+
ddev exec -d /var/www/html/app mkdir tmp/cache
50+
fi
51+
52+
if test -d app/tmp/templates; then
53+
echo "Template directory already created"
54+
else
55+
ddev exec -d /var/www/html/app mkdir tmp/templates
56+
fi
57+
58+
Audit
59+
#ddev exec -d /var/www/html/www/app/public php -q -S 0.0.0.0:8000

0 commit comments

Comments
 (0)