build: use $WEBROOT consistently

This commit is contained in:
Steve Purcell 2013-08-24 17:11:37 +01:00
parent 201fac8639
commit 12bd848555

View file

@ -1,6 +1,7 @@
#!/bin/bash #!/bin/bash
export LANG=en_US.UTF-8 export LANG=en_US.UTF-8
WEBROOT=${WEBROOT:-$HOME/www}
function timestamp { function timestamp {
date "+%Y%m%d %H:%M %z" date "+%Y%m%d %H:%M %z"
@ -12,12 +13,11 @@ function unix_timestamp {
function melpa { function melpa {
timestamp timestamp
timestamp > $HOME/www/status.txt timestamp > $WEBROOT/status.txt
echo "building..." >> $HOME/www/status.txt echo "building..." >> $WEBROOT/status.txt
MELPADIR=${MELPADIR:-$HOME/melpa} MELPADIR=${MELPADIR:-$HOME/melpa}
MELPABRANCH=${MELPABRANCH:-master} MELPABRANCH=${MELPABRANCH:-master}
WEBROOT=${WEBROOT:-$HOME/www}
PATH=$HOME/.cabal/bin:$HOME/usr/bin:$HOME/bin:$PATH PATH=$HOME/.cabal/bin:$HOME/usr/bin:$HOME/bin:$PATH
@ -55,14 +55,14 @@ function melpa {
/usr/sbin/sendmail dcurtis@milkbox.net < ${EMAIL} /usr/sbin/sendmail dcurtis@milkbox.net < ${EMAIL}
cat ${ENVLOG} ${STDERR} ${STDOUT} | tee $WEBROOT/lastrun.txt cat ${ENVLOG} ${STDERR} ${STDOUT} | tee $WEBROOT/lastrun.txt
timestamp > $HOME/www/status.txt timestamp > $WEBROOT/status.txt
echo "completed" >> $HOME/www/status.txt echo "completed" >> $WEBROOT/status.txt
echo '{"completed":' `unix_timestamp` '}' > $HOME/www/build-status.json echo '{"completed":' `unix_timestamp` '}' > $WEBROOT/build-status.json
} }
if [[ `cat $HOME/www/updatemelpa.txt` == 1 ]] ; then if [[ `cat $WEBROOT/updatemelpa.txt` == 1 ]] ; then
echo "Running MELPA" echo "Running MELPA"
echo "2" > $HOME/www/updatemelpa.txt echo "2" > $WEBROOT/updatemelpa.txt
melpa melpa
echo "0" > $HOME/www/updatemelpa.txt echo "0" > $WEBROOT/updatemelpa.txt
fi fi