docker_practice/.travis/docker-entrypoint.sh

22 lines
309 B
Go
Raw Normal View History

2017-11-21 11:05:06 +00:00
#!/bin/sh
START=`date "+%F %T"`
if [ $1 = "sh" ];then sh ; exit 0; fi
rm -rf node_modules _book
srcDir=$PWD
2017-11-21 11:05:06 +00:00
cp -a . /srv/gitbook
cd /srv/gitbook
2017-11-21 11:05:06 +00:00
main(){
if [ "$1" = build ];then gitbook build; cp -a _book $srcDir; echo $START; date "+%F %T"; exit 0; fi
2017-12-31 02:30:53 +00:00
exec gitbook serve
2017-11-21 11:05:06 +00:00
exit 0
}
main $1 $2 $3