[patchew-devel] Re: Automating next.patchew.org deployment

  • From: Paolo Bonzini <pbonzini@xxxxxxxxxx>
  • To: patchew-devel@xxxxxxxxxxxxx, Fam Zheng <famz@xxxxxxxxxx>
  • Date: Thu, 1 Mar 2018 09:35:49 +0100

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.

It works!  (And I have added a few dummy HTML test logs to
next.patchew.org, so you can look at
http://next.patchew.org/Patchew/20180228124135.586-1-pbonzini@xxxxxxxxxx/
and see ansi2html at work :)).

Paolo

#!/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



Other related posts: