Practices while releasing the python/ruby/script based web applications on production

旧巷老猫 提交于 2019-12-07 18:58:26

I would create a branch in SVN for every release of web application and when the release is ready there, I would check it out on the server and set to be run or move it into the place of the old version.

Is SVN checkout and svn update are the right methods to update the latest build files into the server?

Very, very good methods. You know what you got. You can go backwards at any time.

Are there any downside in using svn update? None.

Any better method to release the script/web based scripts into the production server?

What we do.

We do not run out of the SVN checkout directories. The SVN checkout directory is "raw" source sitting on the server.

We use Python's setup.py install to create the application in /opt/app/app-x.y directory tree. Each tagged SVN branch is also a branch in the final installation.

Ruby has gems and other installation tools that are probably similar to Python's.

Our web site's Apache and mod_wsgi configurations refer to a specific /opt/app/app-x.y version. We can then stage a version, do testing, do things like migrate data from production to the next release, and generally get ready.

Then we adjust our Apache and mod_wsgi configuration to use the next version.

Previous versions are all in place. And left in place. We'll delete them some day when they confuse us.

The one downside of doing an svn update on your web root is that the .svn directories can potentially be made public, so be careful about permissions on the web server.

That said, there are far better ways to deploy an app built with dynamic languages. In the Rails world Capistrano is a mature deployment tool, as well as Vlad the Deployer. Capistrano can easily be used for non-rails deployments

There are many deployment strategies based on version control. You could go through the tutorials and get some ideas.

I'd also like to add that even though we do not "build" (compile) the project in dynamic languages, we do "build" (test/integration) them. A serious project would use a continuous integration server to validate the integrated "build" of project on every commit or integration, well before it gets to production.

One downside of doing an svn update: though you can go back in time, to what revision do you go back to? You have to look it up. svn update pseudo-deployments work much cleaner if you use tags - in that case you'd be doing an svn switch to a different tag, not an svn update on the same branch or the trunk.

You want to tag your software with the version number something like 1.1.4 , and then have a simple script to zip it up application-1.1.4,zip, and deploy it - then you have automated repeatable releases and rollbacks as well as greater visibility into what is changing between releases.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!