How can I use post-commit hooks to copy committed files to a web directory from SVN?

后端 未结 3 766
长情又很酷
长情又很酷 2021-01-11 18:00

My Ubuntu server has Apache and Subversion installed. I use this server as a staging server, purely for testing purposes. I use Apache to host the web application, and Subve

3条回答
  •  醉梦人生
    2021-01-11 18:50

    It can be done, but automatically pushing every commit to the production website isn't always a good idea. Sometimes there are other changes that need to go along, and breaking the site because the new code is there, but the database schema hasn't been updated yet is just embarrassing.

    What I tend to do instead is make the server checkout a copy of svn, then, once I'm ready with everything else that has to happen, I do an svn update on it.

    But if you really wanted, you can put commands in the post-commit trigger, that will do everything automatically for you. This could include running a migration script on the server (if one exists for this change), to take care of any non-code changes that need to happen.

提交回复
热议问题