2022-02-15 16:49:40 +01:00
|
|
|
### Sito di hackrocchio
|
2020-03-05 00:21:39 +01:00
|
|
|
|
2022-02-15 16:49:40 +01:00
|
|
|
Fatto con [mkdocs](https://www.mkdocs.org/).
|
|
|
|
Puoi cambiare i testi dei markdown anche qui, poi qualcuno fara' il deploy.
|
|
|
|
|
|
|
|
|
|
|
|
#### Deploy
|
|
|
|
niente CI, niente webhook, devi mettere questo qui sotto in `.git/hooks/pre-push` e renderlo `+x`
|
|
|
|
|
|
|
|
```sh
|
|
|
|
#!/bin/sh
|
|
|
|
remoteUser="root"
|
|
|
|
remoteServer="castro.cose.belle"
|
|
|
|
remotePath="/var/www/hackrocchio"
|
|
|
|
localPath="./site/"
|
|
|
|
buildCmd="mkdocs build"
|
|
|
|
|
|
|
|
current_branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,')
|
|
|
|
|
|
|
|
if [ $current_branch = "master" ]; then
|
|
|
|
$buildCmd
|
|
|
|
echo Updating files...
|
|
|
|
rsync -rzhe ssh --delete --filter=':- .gitignore' ./site/ $remoteUser@$remoteServer:$remotePath
|
|
|
|
fi
|
|
|
|
|
|
|
|
# and you're done!
|
|
|
|
exit 0
|
|
|
|
```
|
2020-03-05 00:24:14 +01:00
|
|
|
|