How to get started deploying PHP applications from a subversion repository?

后端 未结 8 1121
孤城傲影
孤城傲影 2020-12-23 12:06

I\'ve heard the phrase \"deploying applications\" which sounds much better/easier/more reliable than uploading individual changed files to a server, but I don\'t know where

相关标签:
8条回答
  • 2020-12-23 12:59

    After 3 years, I've learned a bit about deployment best practices. I currently use a tool called Capistrano because it's easy to set up and use, and it nicely handles a lot of defaults.

    The basics of an automated deployment process goes like this:

    1. Your code is ready for production, so it is tagged with the version of the release: v1.0.0
    2. Assuming you've already configured your deployment script, you run your script, specifying the tag you just created.
    3. The script SSH's over to your production server which has the following directory structure:

      /your-application
          /shared/
              /logs
              /uploads
          /releases/
              /20120917120000
              /20120918120000  <-- latest release of your app
                  /app
                  /config
                  /public
                  ...etc
          /current --> symlink to latest release
      
      Your Apache document root should be set to /your-application/current/public
      
    4. The script creates a new directory in the releases directory with the current datetime. Inside that directory, your code is updated to the tag you specified.

    5. Then the original symlink is removed and a new symlink is created, pointing to the latest release.

    Things that need to be kept between releases goes in the shared directory, and symlinks are created to those shared directories.

    0 讨论(0)
  • 2020-12-23 13:01

    check fredistrano, it's a capistrano clone works great (litle bit confusing installing but after all runs great)

    http://code.google.com/p/fredistrano/

    0 讨论(0)
提交回复
热议问题