开发者

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

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.


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/


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜