Best Practices for Code/Web Application Deployment?

前端 未结 4 2061
无人共我
无人共我 2020-12-15 00:38

I would love to hear ideas on how to best move code from development server to production server.

A list of gotcha\'s, don\'t do this list would be helpful.

4条回答
  •  感情败类
    2020-12-15 01:28

    In a nutshell...

    You should start with some source control solution - probably Subversion or Git. Once that's in place you can create a script that generates a clean build of your source code and deploys it to your production server(s).

    You could do this with a simple batch script or use something like Ant for more control. Here is a simple example of a batch file using Subversion:

    svn copy svn://path/to/your/project/trunk -r HEAD svn://path/to/your/project/tags/%version%
    svn checkout svn://path/to/your/project/trunk -r HEAD //path/to/target/directory
    

    Ant makes it easy to do things like automatically run unit tests and sync directories. For example:

    
      
        
        
      
    
    

    This is really just a starting point. A next step might be a continuous integration solution like Hudson. I would also recommend reading "Pragmatic Project Automation: How to Build, Deploy, and Monitor Java Applications".

    One ColdFusion specific gotcha is to make sure you clear the Application scope when required (to update any singleton components). A common approach here is to use a URL parameter that causes onRequestStart() to call onApplicationStart(). You may also have to clear the trusted cache.

提交回复
热议问题