2011-09-03 80 views
1

我有一个CI 2.0项目在VCS瓦特/回购托管在我的服务器上。目前我有一个bash脚本,我已经在下面发布。它检出源代码,移动一些文件,并重新启动服务器以反映更新的网站。Codeigniter部署过程

w /我现在的方法有什么问题吗?还有其他人对我可以使用的其他工具有什么其他建议吗?或者有其他方法可以做得更好?谢谢!

# 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 
+0

我使用http://docs.fabfile.org/en/1.2.2/index.html – Vamsi

回答

0

我工作使用本地WAMP目录,其中存储我的项目(DreamWeaver自动做的东西)的目录。然后,我使用DreamWeaver直接与实时服务器一起工作。所以每次我编辑一个文件,它会覆盖在我的本地目录中。现场服务器会立即做出更改,然后当我准备提交到SVN中继时,我只需运行SmartSVN(或任何您使用的),然后将我的本地WAMP目录提交给SVN。

我不知道它是否是最好的选择,但它最有可能比重新启动Web服务器进行更改更好。

0

嗯,我发现了一个更简单的方法来更新我的网站。我不再重新启动Apache了:)查看下面的脚本。

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