A simple Python deployment problem - a whole world of pain

后端 未结 8 717
无人共我
无人共我 2020-12-22 16:34

We have several Python 2.6 applications running on Linux. Some of them are Pylons web applications, others are simply long-running processes that we run from the command lin

8条回答
  •  遥遥无期
    2020-12-22 17:15

    It sounds like what you want is a build script. So write one, using shell, python, ant, or your favorite build tool. If you don't like writing in XML, pant allows you to write ant scripts in python. Several people have mentioned buildout but I don't have any experience with it.

    First define your steps. It sounds like you want to:

    1. SVN export from your production tag (you don't want to have a working copy in prod)
    2. set virtualenv
    3. easy_install or pip install required packages (or probably use pre-downloaded & tested versions)
    4. copy production configuration files to your target (it's not a good idea to keep this information in your source repo -- though you could have them versioned separately)
    5. restart your server & do any other setup task
    6. run smoke tests and rollback on failure

    If you're doing load balancing or depending on other services production you might want to figure out a way to roll out limited scope so all your customers aren't affected at once. If you have a production-like staging environment that might also satisfy that need.

提交回复
热议问题