|
1 | 1 | # clue.engineering |
2 | 2 |
|
3 | | -Source code for https://clue.engineering/ |
| 3 | +Source code for the https://clue.engineering/ website. |
4 | 4 |
|
5 | | -## Install |
| 5 | +## Build |
6 | 6 |
|
7 | | -Install dependencies: |
| 7 | +You can build the website like this: |
8 | 8 |
|
9 | 9 | ```bash |
10 | | -composer install |
| 10 | +make |
11 | 11 | ``` |
12 | 12 |
|
13 | | -Build website: |
| 13 | +Once built, you can manually browse the `build/` directory or run the web server |
| 14 | +container (Apache) in the foreground like this: |
14 | 15 |
|
15 | 16 | ```bash |
16 | | -vendor/bin/sculpin generate |
| 17 | +make serve |
17 | 18 | ``` |
18 | 19 |
|
19 | | -This will create a `build/` directory that contains the static website that can |
20 | | -be accessed with a web browser. |
| 20 | +Alternatively, you may also run the web server container (Apache) as a |
| 21 | +background daemon like this: |
21 | 22 |
|
22 | | -## Deploy |
23 | | - |
24 | | -Then deploy `build/` behind your favorite webserver (Apache + PHP-FPM etc.). |
25 | | - |
26 | | -Additionally, this should be deployed behind a reverse proxy (nginx) that is |
27 | | -responsible for HTTPS certificate handling and forcing HTTPS redirects. |
28 | | - |
29 | | -Additionally, Apache has been configured to cache static files for 1 day. |
| 23 | +```bash |
| 24 | +make served |
| 25 | +``` |
30 | 26 |
|
31 | | -For testing purposes, you can use the official `php` docker image like this: |
| 27 | +Once running, you can run some integration tests that check correct paths etc. |
| 28 | +like this: |
32 | 29 |
|
33 | 30 | ```bash |
34 | | -docker run -it --rm -p 80:80 -v "$PWD"/build:/var/www/html php:8.1-apache sh -c "ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled; apache2-foreground" |
| 31 | +make test |
35 | 32 | ``` |
36 | 33 |
|
37 | | -## Tests |
| 34 | +> This test assumes you're running the above web server container on |
| 35 | +> `http://clue.localhost`. You may test other deployments like this: |
| 36 | +> |
| 37 | +> ```bash |
| 38 | +> tests/acceptance.sh https://clue.example |
| 39 | +> ``` |
38 | 40 |
|
39 | | -You can run some simple acceptance tests to verify the deployed website works |
40 | | -as expected by running: |
| 41 | +Once done, you can clean up like this: |
41 | 42 |
|
42 | 43 | ```bash |
43 | | -tests/acceptance.sh https://clue.test |
| 44 | +make clean |
44 | 45 | ``` |
45 | 46 |
|
46 | | -If you're using the above `php` docker image, you can run this test like this: |
| 47 | +## Deploy |
47 | 48 |
|
48 | | -```bash |
49 | | -tests/acceptance.sh http://clue.localhost |
50 | | -``` |
| 49 | +Once built (see previous "Build" section), you can simply deploy the `build/` |
| 50 | +directory behind your favorite web server (Apache + PHP-FPM etc.). |
| 51 | + |
| 52 | +Additionally, this should be deployed behind a reverse proxy (nginx) that is |
| 53 | +responsible for HTTPS certificate handling and forcing HTTPS redirects. |
| 54 | + |
| 55 | +Additionally, Apache has been configured to cache static files for 1 day. |
0 commit comments