2018-05-14 20:52:16 +03:00
|
|
|
#!/bin/sh
|
|
|
|
# Update website(s): hledger.org
|
|
|
|
#
|
2018-05-14 22:14:00 +03:00
|
|
|
# Called via github webhook (on push to main repo or wiki)
|
2018-05-14 20:52:16 +03:00
|
|
|
# /etc/supervisord.conf -> [program:github-post-receive]
|
|
|
|
# /etc/github-post-receive.conf
|
2018-05-14 22:14:00 +03:00
|
|
|
# and via cron (nightly)
|
|
|
|
# /etc/crontab
|
|
|
|
# or manually (make deploy)
|
2018-05-14 20:52:16 +03:00
|
|
|
|
|
|
|
(\
|
|
|
|
|
|
|
|
# timestamp
|
|
|
|
echo && date --rfc-3339=seconds && \
|
|
|
|
|
2018-05-17 04:33:23 +03:00
|
|
|
# fetch latest code & website - sometimes already done by webhook, not always
|
|
|
|
git pull && \
|
2018-05-14 20:52:16 +03:00
|
|
|
|
|
|
|
# fetch latest wiki content
|
2018-05-14 22:14:00 +03:00
|
|
|
printf "wiki: " && git -C wiki pull && \
|
2018-05-14 20:52:16 +03:00
|
|
|
|
2018-05-16 21:58:08 +03:00
|
|
|
# add latest wiki sidebar links to home page, and push right away so we can keep pulling
|
|
|
|
make --no-print-directory site/index.md-push && \
|
2018-05-14 20:52:16 +03:00
|
|
|
|
2018-05-14 22:14:00 +03:00
|
|
|
# ensure GHC can handle non-ascii
|
2018-05-14 20:52:16 +03:00
|
|
|
export LANG=en_US.UTF-8 && \
|
|
|
|
|
|
|
|
# ensure latest Shake is built
|
|
|
|
./Shake.hs \
|
|
|
|
|
|
|
|
# update website's generated content (eg manuals) and html
|
|
|
|
./Shake website \
|
|
|
|
|
|
|
|
# print and log to:
|
|
|
|
) 2>&1 | tee -a deploy.log
|