How to best update a website from subversion

前端 未结 10 1814
无人及你
无人及你 2021-01-01 02:45

I have a PHP website backed by a MySQL database and a small team of programmers submitting code to subversion. Typically we write code, test it locally, commit to subversio

相关标签:
10条回答
  • 2021-01-01 03:08

    If you install the Subversion command line client, it's quite easy to make a batch file/shell script that will do a checkout export of the latest revision from the repository to a folder on the server. This requires that you have the same file structure in Subversion as you do on the server though (unless you want to add the logic to change the structure in the script, of course).

    0 讨论(0)
  • 2021-01-01 03:12

    We deploy via Subversion and use database migration tools (with schema versioning) to do this.

    (http://blog.lavablast.com/post/2008/02/I2c-for-one2c-welcome-our-new-revision-control-overlords!.aspx)

    (We develop in .NET)

    0 讨论(0)
  • 2021-01-01 03:16

    Have you checked out Beanstalk? http://beanstalkapp.com/ It's a SVN/GIT server and it features automatic FTP deployment.

    0 讨论(0)
  • 2021-01-01 03:21

    I wouldn't recommend checking out your code to your production server. This can potentially expose svn control files (.svn) on the server.

    I would recommend using a script (python, ruby, etc.) combined with the command line svn and FTP client to export the files from svn and ftp the files to the server. The svn export command can be used to check out a set of files from the svn server without all the .svn directories. Also, don't forget to tag the svn repository when doing this so you have a checkpoint of what you have deployed.

    0 讨论(0)
  • 2021-01-01 03:23

    I recommend that you write some sort of script that does this for you. Whether you do this with PHP or something else is up to you. Just keep security in mind when you do this.

    Doing an export of your project won't export any svn:externals you might have set which means you need to do multiple exports. When you script this it shouldn't of course being much of an issue. Another thing with exports, if you project is large (if you use lots of video, PDF's etc.) then an export can be quite cumbersome, especially when your version control is hosted off-site and only available through HTTP.

    I recommend you do a checkout and make sure that your server can't serve any files located in the hidden .svn folders.

    0 讨论(0)
  • 2021-01-01 03:23

    I would recommend:

    • copying each old build to its own directory (for quick restores; you probably only need to keep one of these) in a non-web-accessible part of your server.
    • Then use svn export to get the entire new build from svn. Don't use svn checkout, as this will leave .svn directories all over the place.
    0 讨论(0)
提交回复
热议问题