forked from robin-nitrokey/nitrokey-documentation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
apply_new_content.sh
executable file
·29 lines (20 loc) · 1.04 KB
/
apply_new_content.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
echo "$(date) [apply_new_content.sh] Content change triggered." >> /var/www/sphinx/logs_sphinx/webhook.log
cd /var/www/sphinx/sphinx/nitrokey-documentation
# pull new content
git pull
# clean excluded files
#git clean -f -d
# build english version
echo "$(date) [apply_new_content.sh] Repo pulled. Building englisch Versions..." >> /var/www/sphinx/logs_sphinx/webhook.log
sphinx-build -a -D language='en' -b html . /var/www/sphinx/www/docs.nitrokey.com_en_temp
mv /var/www/sphinx/www/static/?? /var/www/sphinx/www/docs.nitrokey.com_en_temp/
rm /var/www/sphinx/www/static -r
mv /var/www/sphinx/www/docs.nitrokey.com_en_temp /var/www/sphinx/www/static
echo "$(date) [apply_new_content.sh] DONE. Building /locales/ and pushing upstream..." >> /var/www/sphinx/logs_sphinx/webhook.log
# generate language files and push
sphinx-build -b gettext . ./locales/
sphinx-intl update -p ./locales/ -l de -l fr
git add --all
git commit -m "Language Files generated by Sphinx"
git push
echo "$(date) [apply_new_content.sh] DONE" >> /var/www/sphinx/logs_sphinx/webhook.log