开发者

Codeigniter Deployment Process

I have a CI 2.0 project under VCS w/ the repo hosted on my server. Currently I have a bash script that I've posted开发者_如何学JAVA below. It checks out the source code, moves some files around, and restarts the server to reflect the updated web site.

Is there anything wrong w/ my current method? Does anyone else have any other recommendations on other tools I could use or ways to do it better? Thanks!

# Stop apache while we update the server, and export our svn repo to a tmp dir
sudo /etc/init.d/apache2 stop
svn export file:///home/steve/repository/example/trunk /home/steve/example_dev/

# Prepare the public_html folder for the update, and remove the tmp directory
rm -rf /home/steve/public_html/example.com/public/
mv /home/steve/example_dev/ /home/steve/public_html/example.com/public/
rm -rf /home/steve/public_html/example.com/public/license.txt
rm -rf /home/steve/public_html/example.com/public/user_guide
rm -rf /home/steve/example_dev

# Restart apache
sudo /etc/init.d/apache2 start


I work using a local WAMP directory, which stores the directories of my projects (something DreamWeaver automatically does). I then use DreamWeaver to work directly with the live server. So everytime I edit a file it overwrites in my local directory. Changes are made instantly on the live server, which then when I'm ready to commit to my SVN trunk I simply run SmartSVN (or whatever you use) then commit my local WAMP directory to the SVN.

I don't know if it's the best option really, but it's most likely better than rebooting your webserver for changes.


Well I have a found a much simpler way to update my site now. No longer am I restarting Apache either :) Check out my script below.

svn export --force file:///home/steve/repo/example/trunk \
 /home/steve/public_html/example.com/public/


We use Capistrano for CI and other PHP deployments. It works pretty well. https://github.com/namics/capistrano-php

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜