0

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.

user187580
  • 2,275
  • 11
  • 32
  • 39

2 Answers2

3

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
  • 2,974
  • 1
  • 18
  • 8
  • 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 Oct 26 '09 at 16:21
0

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

mauris
  • 42,982
  • 15
  • 99
  • 131