README.md 1.52 KB
Newer Older
1
# Parashift Module Documenation
squidfunk's avatar
squidfunk committed
2

3
This repository is an `mkdocs` project that provides the documentation to Parashift's Modules
squidfunk's avatar
squidfunk committed
4

peter's avatar
peter committed
5

peter's avatar
peter committed
6 7 8 9 10 11 12 13 14
## Requirements

Requires:

* [python with pip](https://www.python.org/)
* [yarn](https://yarnpkg.com/lang/en/docs/install/)

### Tool setup

15
Run these to ensure you have these tools up to date:
peter's avatar
peter committed
16 17 18 19 20 21 22 23 24 25 26 27 28

```
pip install mkdocs
pip install pygments
```

### Environment setup

```
pip install -r requirements.txt
yarn install
```

29 30
### Apache Webserver

31
The following apache config will host a server of the docs under `/opt/docs`:
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

```
<VirtualHost *:80>
   ServerName docs.parashift.com.au
   Redirect permanent / https://docs.parashift.com.au/
</VirtualHost>

<VirtualHost *:443>
  ServerName docs.parashift.com.au
  SSLEngine On
  SSLProxyEngine On
  ProxyRequests Off
  ProxyPreserveHost On
  SSLCertificateFile /etc/apache2/server.cert
  SSLCACertificateFile /etc/apache2/intermediate.cert
  DocumentRoot /opt/docs/site

<Directory "/opt/docs/site">
  AllowOverride All
  Require all granted
</Directory>
</VirtualHost>
```

### Updating periodically

Using git post hooks you can update the site periodically.

First create a file in `.git/hooks/post-merge` with the following contents:

```
#!/bin/bash

peter's avatar
peter committed
65
yarn run build
66 67 68 69 70 71 72 73 74 75 76 77 78
```

Run `chmod +x .git/hooks/post-merge` to ensure it's executable

Then create a cron job accordingly under `/etc/cron.d`:

```
*/15 * * * * root cd /opt/docs && git pull -q >> /var/log/docsupdate.log 2>&1
```

#### Testing

Run `git pull -q` manually after some changes to confirm the post-merge is working