[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to automatically update files on alioth from svn

On Wed, Oct 26, 2005 at 03:38:08PM +0200, Frank Küster wrote:

> I'd like to keep the files in the "Project Home Page" area of alioth in
> our SVN repository, and I'm looking for a way to automate the updating
> of these pages.

I've done if for a number of projects (like buffy).  You can have a look
at the hooks in buffy to see what they do, and I'll summarize it here.

To begin with, the webspace is an *anonymous* svn checkout of the files.

> - how to write the hook so that only specific files are uploaded, and
>   put into the right location

In post-commit, I have:

  # Update the contents of the website
  if svnlook dirs-changed $REPOS | grep -q '^web/trunk/'
	echo "Thanks" | mail -s "Update buffy web pages, please" enrico@haydn.debian.org

svnlook checks that the commit involve the web area.  The mail asks
haydn to call svn up; this is needed because the svn repo and the web
pages are not in the same machine.

> - how to authenticate the transfer, since the svn repository and the
>   webspace is on different machines.

Then on haydn I have a procmail rule that sees the e-mail and calls svn
up appropriately.  Ask me again later if you need the procmail rule, as
I can't get to alioth right now).  If someone sends extra mails it's
just idempotent svn up commands so it wouldn't matter.  If you're
concerned about DOS attacks, touch a file after doing svn up and don't
do it again before one minute.

Better ideas would of course be welcome.



GPG key: 1024D/797EBFAB 2000-12-05 Enrico Zini <enrico@debian.org>

Attachment: signature.asc
Description: Digital signature

Reply to: