This is supposed to be in svn post-commit hook file:
#get username of the user making commit
user=$(/usr/local/bin/svnlook author -r $REV $REPOS)
#send email message to admin
/usr/local/bin/php mail.php "from@email" "$user/$1" "to@email" "$log"
Code for mail.php is here:
<?php
//script usage php mail.php <fromemail> <subject> <toemail> <text>
if ($argc<5) die ("script usage php mail.php <fromemail> <subject> <toemail> <text>");
$frommail=$argv[1];
$subj=$argv[2];
$tomail=$argv[3];
$text=$argv[4];
$rez=mail($tomail, "$subj", $text,
"From: $frommail\nReply-To: $frommail");
if (!$rez) die ("error sending mail to $tomail");
?>
Показаны сообщения с ярлыком svn. Показать все сообщения
Показаны сообщения с ярлыком svn. Показать все сообщения
воскресенье, 10 января 2010 г.
суббота, 29 декабря 2007 г.
Subversion (SVN) updates over FTP and SSH
Sometimes it is reasonable to make svn updates to another server. While your project repository is stored at your test host, production server may not support svn feature at all...
Here is how to do it in svn post-commit hook:
A. FTP
rm -R /path/to/your/distr ## remove old files
checkout -r $REV svn://yoursvnhost.com /path/to/your/distr
cd /path/to/your/distr
gfind -name .svn -print0 xargs -0 rm -rf ##remove svn stuff
ncftpput -m -R -u username -p password hostname /target_path /path/to/your/distr
B. SSH
scp -r /path/to/your/distr/* username@host:/target_path
isn ssh way you will need to generate ssh public key file to your target host.
Here is how to do it in svn post-commit hook:
A. FTP
rm -R /path/to/your/distr ## remove old files
checkout -r $REV svn://yoursvnhost.com /path/to/your/distr
cd /path/to/your/distr
gfind -name .svn -print0 xargs -0 rm -rf ##remove svn stuff
ncftpput -m -R -u username -p password hostname /target_path /path/to/your/distr
B. SSH
scp -r /path/to/your/distr/* username@host:/target_path
isn ssh way you will need to generate ssh public key file to your target host.
Подписаться на:
Сообщения (Atom)
