gitbook好是好,就是需要本地编译,或者直接使用gitbook官方服务。
对于自己编译,琢磨了一个小的可以定时checkout代码并在有变动的时候进行自动编译和更新的小脚本。
#!/bin/bash
result=`git pull`
[[ $result = "Already up-to-date." ]] && exit 0 || echo "文件已更新"
source ~/.bashrc
gitbook build ./ ../html/
#scp -r ../html/* root@xxx:/www/webapps/book.opschina.org/
# 换成了rsync,因为如果是scp的话,一个一个文件拷贝覆盖太慢了。
rsync -avzP ../html/* root@xxx:/www/webapps/book.opschina.org/
定时任务
# book.opschina.org
*/5 * * * * cd /opt/gitbook/snowbearopjournal && ./build.sh
412

被折叠的 条评论
为什么被折叠?



