2020-05-25 11:42:00 +02:00
|
|
|
#!/usr/local/bin/zsh -x
|
|
|
|
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:$HOME/bin
|
|
|
|
|
|
|
|
[ -f $HOME/lock ] && exit 1
|
|
|
|
touch $HOME/lock
|
|
|
|
|
|
|
|
echo 'rebuilding mempool sites'|wall
|
|
|
|
|
2020-06-20 18:53:24 +02:00
|
|
|
cd "$HOME/mempool"
|
|
|
|
git pull origin master
|
|
|
|
cd "$HOME/"
|
|
|
|
|
2020-05-25 11:42:00 +02:00
|
|
|
for site in mainnet liquid testnet
|
|
|
|
do
|
|
|
|
cd "$HOME/${site}"
|
|
|
|
git pull origin master
|
|
|
|
hash=$(git rev-parse HEAD)
|
2020-05-26 14:33:50 +02:00
|
|
|
|
|
|
|
if [ "${site}" = "mainnet" ]
|
|
|
|
then
|
|
|
|
cd "$HOME/${site}/frontend"
|
|
|
|
npm install
|
|
|
|
npm run build
|
|
|
|
rsync -av ./dist/mempool/* "${HOME}/public_html/${site}/"
|
|
|
|
fi
|
|
|
|
|
2020-05-25 11:42:00 +02:00
|
|
|
cd "$HOME/${site}/backend"
|
2020-05-26 14:33:50 +02:00
|
|
|
npm install
|
2020-05-25 11:42:00 +02:00
|
|
|
npm run build
|
|
|
|
done
|
|
|
|
|
|
|
|
ps uaxw|grep 'node dist/index'|grep -v grep|awk '{print $2}'|xargs -n 1 kill
|
|
|
|
|
2020-06-20 18:53:24 +02:00
|
|
|
hostname=$(hostname)
|
|
|
|
keybase chat send --channel dev mempool "${hostname} updated to ${hash}"
|
2020-05-25 11:42:00 +02:00
|
|
|
|
|
|
|
rm "$HOME/lock"
|