权限问题post-commit hook failed (exit code 255) with no output


svn提交出现post-commit hook failed (exit code 255) with no output多半是权限问题
查找相关文章:post-commit subversion

svn提交出现post-commit hook failed (exit code 255) with no output多半是权限问题

这个困扰了我一天 唉

安装subversion网上的资料比较多

可以参考

http://hyjk2000.sinaapp.com/2012/04/18/setup-subversion-on-web-server/

http://www.ibm.com/developerworks/cn/java/j-lo-apache-subversion/

subversion提交代码同步到web目录

1.从模板里面拷贝一份

cp post-commit.tmpl post-commit


2.在末尾加入

WEB_PATH="/var/www/html/domain.com"
"/usr/bin/svn" update --username user1 --password passwd1 "$WEB_PATH" >> "/var/www/html/
code_deploy_log"


3.赋予post-commit可执行权限

chmod +x ./post-commit
chown apache:apache ./post-commit


4.checkout一份备份

cd /var/www/html/domain.com
svn co file:///svn/project/www /var/www/html/domain.com --username user1 --password passwd


5.赋予web目录apache权限

chown -R apache:apache /var/www/html/domain.com