views:

89

answers:

2

Is it possible to automatically transfer/ftp files to a server, every time I commit a change to a repository??

If yes, please help me know how to set it up.

Thanks.

A: 

You will need to write a webpage / script that is called via the web after the commit is done using Post commit web hooks.

An example: http://code.google.com/p/support/wiki/PostCommitWebHooks

thephpdeveloper
+3  A: 

As you tagged the question, you want a post-commit hook to run the copy. You could get away with just using scp:

scp -r /path/to/source/dir user@host:/path/to/destination/dir/

You'll need to create an SSH key on your SVN server and add the contents of the public key file (the one ending in .pub) to the target machine's ~/.ssh/authorized_keys file to let you get away without needing a password.

EDIT: full sample postcommit hook:

#!/bin/bash
scp -r /path/to/source/dir user@host:/path/to/destination/dir/
Jamie Macey
where do I run this scp command?
See Mauris' link to Postcommit hook documentation - if your postcommit hook file is currently empty, you can just set it up as a bash script - I added a sample script above.
Jamie Macey