On 01/03/2018 03:54, Fam Zheng wrote:
I wrote this script on the server and run it with cron to keep
next.patchew.org
in sync with patchew.git master. Let's see how it works when next commit is
pushed.
#!/bin/bash
set -e
cd ~/patchew.git
git fetch
cur=$(git rev-parse master)
if test -f ~/.patchew-next-head; then
prev=$(cat ~/.patchew-next-head)
fi
if [ "$cur" = "$prev" ]; then
exit 0
fi
rm -rf /tmp/patchew-next-deploy
git clone ~/patchew.git /tmp/patchew-next-deploy
cd /tmp/patchew-next-deploy
./scripts/deploy -s root@localhost -e 'instance_name="patchew-next"
superuser_name="" superuser_pass=""'
echo $cur > ~/.patchew-next-head