2. a hook for you

| No Comments

Em, I mean a commit hook. What can such a thing do for you? Let's see by example. There are two usages for ba.pm.org.

1st to send out colourful notification email when someone do a commit to all interested parties.

2nd when the commit is made to the place where the final page is stored, to update the web folder = publish live the changes.

post-commit:

#!/bin/sh

REPOS="$1"
REV="$2"

# send diff email after commit
/usr/bin/svnnotify -r $REV -C -d -H HTML::ColorDiff \
    -p $REPOS -f 'svn@cle.sk' \
    --subject-prefix "[$REV] `svnlook author -r $REV $REPOS`" \
    --to-regex-map 'someone@somewhere.net=^(www/pm|www/tt-pm)' \
    --to-regex-map 'someoneelse@somewhereelse.net=^(www/pm|www/tt-pm)' 

# update bratislava.pm.org site after commit
if [ "`svnlook changed -r $REV $REPOS | grep '^....www/pm'`" ]; then
    sudo -H -u localuser /path/to/update-ba.pm.org;
fi

Leave a comment

Updates

Subscribe to the blog updates with an email:

If you like it, share it.

Pages

About this Entry

This page contains a single entry by Jozef Kutej published on November 5, 2009 7:41 PM.

1. make mehappy     # make for fun and profit was the previous entry in this blog.

3. scraping my self is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.