2020-08-17 17:17:02 +03:00
|
|
|
# Сайт selfprivacy.org
|
|
|
|
|
2020-08-17 19:03:06 +03:00
|
|
|
## Архитектура
|
2020-08-17 17:35:34 +03:00
|
|
|
* CMS — https://gohugo.io/
|
|
|
|
* Тема — https://github.com/mitrichius/hugo-theme-anubis
|
2020-08-17 17:23:36 +03:00
|
|
|
* Графика - https://romannurik.github.io/AndroidAssetStudio/icons-launcher.html
|
2020-08-17 17:35:34 +03:00
|
|
|
* Проверка орфографии и чистоты текста — https://glvrd.ru/
|
2020-08-17 17:23:36 +03:00
|
|
|
|
2020-08-17 19:03:06 +03:00
|
|
|
## Процесс разработки
|
|
|
|
1. `git clone --recursive gitea@git.selfprivacy.org:SelfPrivacy/selfprivacy.org.git`
|
|
|
|
1. Каментим коммиты на английском (рука не поднимается на русском коммит описывать)
|
|
|
|
1. Перед коммитом: `hugo -D server --disableFastRender`
|
|
|
|
1. `git push` выкатит сайт на прод
|
|
|
|
|
|
|
|
## Деплой CI/CD
|
2020-08-17 17:35:34 +03:00
|
|
|
Билдится и выкатывается git post-receive хуком на каждый коммит
|
2020-08-17 17:17:02 +03:00
|
|
|
```sh
|
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
#chown root:nginx /var/www/
|
|
|
|
#chmod -v g+s /var/www/
|
|
|
|
#mkdir /var/www/from_gitea
|
|
|
|
#chown gitea /var/www/from_gitea
|
|
|
|
|
|
|
|
GIT_REPO=/var/lib/gitea/repositories/selfprivacy/selfprivacy.org.git/
|
|
|
|
TEMP_DIRECTORY=/tmp/temp
|
|
|
|
TARGET=/var/www/from_gitea/new
|
|
|
|
SITE_DIR=/var/www/from_gitea/selfprivacy.org
|
|
|
|
|
|
|
|
echo " /==============================="
|
|
|
|
echo " Post receive file active"
|
|
|
|
|
|
|
|
echo " Making temporary directory."
|
|
|
|
mkdir $TEMP_DIRECTORY
|
|
|
|
|
|
|
|
echo " Pulling into temporary directory."
|
|
|
|
git clone --recursive $GIT_REPO $TEMP_DIRECTORY
|
|
|
|
|
2020-09-02 16:08:13 +03:00
|
|
|
echo "Building new site and removing old."
|
|
|
|
hugo -D -s $TEMP_DIRECTORY -d $TARGET && rm -rf $SITE_DIR
|
2020-08-17 17:17:02 +03:00
|
|
|
|
|
|
|
echo " Move new to site dir."
|
|
|
|
mv $TARGET $SITE_DIR
|
|
|
|
|
|
|
|
echo " Removing temporary directory."
|
|
|
|
rm -rf $TEMP_DIRECTORY
|
2020-08-17 19:03:06 +03:00
|
|
|
|
2020-08-17 21:12:43 +03:00
|
|
|
echo " Checking links."
|
|
|
|
linkchecker https://selfprivacy.org --check-extern
|
|
|
|
```
|
2020-08-17 19:03:06 +03:00
|
|
|
|