docker/hexo/start.sh
2018-07-20 13:13:55 +08:00

17 lines
277 B
Bash

#!/bin/bash
if [ ! -e /hexo ]; then
if [ -n "$REPOSITORY" ]; then
cd /;
git clone -b $BRANCH $REPOSITORY hexo;
fi
fi
hexo server --cwd /hexo -p 80 > /logs/hexo.log 2>&1 &
while true;
do
cd /hexo; git pull > /dev/null 2>&1 ;
sleep 5;
done