How to best update a website from subversion

前端 未结 10 1870
无人及你
无人及你 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:30

    Code version management and database version management are two very different problems. The solution that I prefer is done in three stages (Test, Deployment Test, Live) rather than two.

    • Update the code and apply database changes via scripts in the development environment
    • Download the live database to a deployment test environment, restore it and apply the change scripts
    • Test the code against the 'synchronised' live database
    • Update the live environment via svn from the relevant branch on the repository (we do it via ssh tunneling since it's a linux environment) and apply the change scripts to the live db

    Edit: The update for the live environment is best done using export rather than checkout/update. This doesn't leave svn's control file hanging around. This may or may not have security implications, it does force you to specify which branch you're checking out each time though.

    Your 'one click' could probably be scripted for the last step.

提交回复
热议问题