用svn在服务器上通过脚本部署php

可以参考这两个:

http://stackoverflow.com/questions/800294/how-to-get-started-deploying-php-applications-from-a-subversion-repository

http://stackoverflow.com/questions/7049724/php-svn-whats-the-best-way-to-deploy-svn-tag-to-production

我根据上面的弄了一个糙的:

timestamp=`date +%Y%m%d%H%M%S`
svn export http://.../svn/myblog/trunk/myblog  /home/admin/myblog/$timestamp
unlink /home/admin/myblog/current
ln -s /home/admin/myblog/$timestamp /home/admin/myblog/current
sudo /usr/sbin/apachectl stop
sudo /usr/sbin/apachectl start

Leave a Comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.