docker/hexo/start.sh
2018-07-21 09:15:45 +08:00

21 lines
337 B
Bash

#!/bin/bash
if [ ! -e /hexo ]; then
cd /;
git clone -b $BRANCH $REPOSITORY hexo;
fi
if [ -e /hexo ]; then
rm -rf /hexo;
cd /;
git clone -b $BRANCH $REPOSITORY hexo;
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