How to release web applications?

前端 未结 6 1694
逝去的感伤
逝去的感伤 2021-01-31 22:17

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 wh

6条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-31 22:53

    I use Capistrano to script & automate the deployment process. Here's an outline of what happens when I enter cap deploy from my local workstation:

    Capistrano will. . .

    1. Checkout latest version of source in a time-stamped directory (e.g. to /var/http/mywebsite.com/releases/20090715014527) on my webserver, prompting me @ my local workstation for any passwords, if necessary.

    2. Run pre-processing scripts (e.g. update database schema)

    3. Soft link the site to a live directory:

      ln -sf /var/http/mywebsite.com/releases/20090715014527 /var/http/mywebsite.com/current

    4. Run post-processing scripts (e.g. maybe you need to restart apache or something)

    If there were any problems along the way, Capistrano will rollback to the previous working release.

    Although Capistrano is written in Ruby, it can deploy web applications in any language/framework. See the "Deploying non-rails apps" section of the tutorials for ideas. The railsless-deploy seems particularly useful for using Capistrano to manage deploying PHP and Python apps.

提交回复
热议问题