如何发布Web应用程序?

我真的不知道如何在 Web 开发中正确执行从离线开发到实时 Web 服务器的部署.我主要依靠直觉,但这或多或少是我到现在为止所做的:我有一个使用 python 或 php 编写的 Web 应用程序,并且我将它托管在实时网络服务器上.我用的是svn下的离线开发版.

I don't really know how to perform deployment from offline development to live webserver correctly in web development. I mostly resort on intuition, but this is more or less what I did until now: I have a web application in python, or php, and I am hosting it on a live webserver. I use an offline development version whose source is under svn.

现在,当我开发离线版本时,我将对 svn 执行提交.当发布时间到了,我可以:

Now, as I develop the offline version, I will perform commits to the svn. When time has come for release, I could either:

  1. 将代码从离线服务器复制到实时网络服务器上的临时目录,然后将旧代码库与新代码库交换(例如,使用链接),或者...
  2. 让实时网络服务器在结帐 svn 上工作,然后运行 ​​svn update.

我通常做第二个,尽管如果我必须在实时部署之前升级数据库,我通常会编写升级 sql 脚本,然后先在实时数据库上运行它们,然后结帐.

I normally do the second, although if I have to upgrade the database before the live deployment, I normally write upgrade sql scripts, and run them first on the live database, then checkout.

这项任务的最佳实践是什么?

What are the best practices for this task ?



 1 条回答