Open
Description
Currently this script is used via cron on patchew.org
and next.patchew.org
to auto-update the servers:
#!/bin/bash
set -e
BRANCH=master
INSTANCE=patchew-server
cd ~/patchew.git
git fetch
cur=$(git rev-parse $BRANCH)
if test -f ~/.$INSTANCE-head; then
prev=$(cat ~/.$INSTANCE-head)
fi
if [ "$cur" = "$prev" ]; then
exit 0
fi
rm -rf /tmp/$INSTANCE-deploy2
git clone -b $BRANCH ~/patchew.git /tmp/$INSTANCE-deploy2
cd /tmp/$INSTANCE-deploy2
./scripts/deploy -s root@localhost -e 'instance_name="'"$INSTANCE"'" superuser_name="" superuser_pass=""'
echo $cur > ~/.$INSTANCE-head
The script should be moved to an Ansible playbook.