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

StackOverflow https://stackoverflow.com/questions/1621049

  •  06-07-2019
  •  | 
  •  

Question

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.

Was it helpful?

Solution

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/

OTHER TIPS

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top