[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: post-commit hook executed *only* if new tag committed?

From: John Peacock <john.peacock_at_havurah-software.org>
Date: 2007-12-16 02:35:37 CET

Eric White wrote:
> I'm hoping to implement a post-commit script that will update files on a
> production website *only* if a new tag is assigned to my project in the
> repository.

I wrote this module specifically to do this:

        http://search.cpan.org/search?query=SVN::Notify::Mirror

though you'll probably want to use this to make it easier:

        http://search.cpan.org/search?query=SVN::Notify::Config

(which I didn't write originally, but which I have adopted).

Here is an example post-commit script which does what you want:

  #!/usr/bin/perl -MSVN::Notify::Config=$0
  --- #YAML:1.0
  '':
    PATH: "/usr/bin:/usr/local/bin"
  'project/trunk':
    handler: Mirror
    minimal: 1
    to: "/path/to/local/www/htdocs"
  'project/tags':
    handler: Mirror::SSH
    tag-regex: "RELEASE-"
    to: "/path/to/remote/www/htdocs"
    ssh-host: "remote_host"
    ssh-user: "remote_user"
    ssh-tunnel: "10.0.0.2"
    ssh-identity: "/home/user/.ssh/id_rsa"

Any commit to project/trunk (or below) gets mirrored to a test server (in this
case local to the Subversion repository itself). Any tag that is created that
matches the regular expression "RELEASE-" will get mirrored to the remote_host
server, using SSH with a private key, over a tunneled SSH session (so the remote
host doesn't need any route to the Subversion server at all).

John

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Sun Dec 16 02:35:45 2007

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.