more start script and hook refactoring

This commit is contained in:
Matthew Connelly 2015-11-15 23:32:35 +00:00
parent 6eb967dfc0
commit ee204b6686
2 changed files with 9 additions and 4 deletions

View File

@ -1,4 +1,9 @@
#!/bin/sh
cat > /dev/null
git --git-dir /home/sites/blogalba/.git --work-tree /home/sites/blogalba pull
[ ! -z "$(find /home/sites/blogalba -type d -name .git -prune -o -type f -mmin -1 -print|egrep '(p(ost|age)s/|blogalba$)')" ] && echo "Restarting blogalba" && /home/sites/blogalba/scripts/start
BASE=/usr/home/sites; export BASE; APP=blogalba; export APP
START_OPTS="--workers 1"; export START_OPTS
cd $BASE/$APP; git pull; cd -
cd $BASE/$APP.mirror.git; git pull; git push; cd -
#git --git-dir $BASE/$APP/.git --work-tree $BASE/$APP pull
[ ! -z "$(find $BASE/$APP -type d -name .git -prune -o -type f -mmin -1 -print|egrep '(p(ost|age)s/|lib$)')" ] || exit
echo "Restarting $APP"; $BASE/$APP/start

4
start
View File

@ -1,5 +1,5 @@
#!/bin/sh
[ -z "$BASE" ] && BASE=/usr/home/sites
[ -z "$BASE$APP" ] && exit 1
#p5env setup
PATH="$BASE/perl5/bin${PATH+:}${PATH}"; export PATH;
PERL5LIB="$BASE/perl5/lib/perl5${PERL5LIB+:}${PERL5LIB}"; export PERL5LIB;
@ -9,4 +9,4 @@ PERL_MM_OPT="INSTALL_BASE=$BASE/perl5"; export PERL_MM_OPT;
pkill -F $BASE/${APP}.pid 2>/dev/null
for((;;));do pkill -0 -F $BASE/${APP}.pid 2>/dev/null || break; sleep 1; done
plackup -s Starman -D -S $BASE/$APP/.sock $BASE/$APP/app.psgi --pid $BASE/${APP}.pid --workers 1
plackup -s Starman -D -S $BASE/$APP/.sock $BASE/$APP/app.psgi --pid $BASE/${APP}.pid $START_OPTS