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

后端 未结 3 772
长情又很酷
长情又很酷 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 19:00

    I think the real, overarching question you should be asking yourself---which you may already have asked yourself of course---is this: "how can I test my code most easily before deploying it?"

    I think a good answer is to install Apache on your development box and run it as your own user, with webroot and/or cgi path at /home/richardhenry/src/mywebsite (or whereever you check out your code).

    That way, you can test your code without even committing. As a result, you won't litter your trunk with broken or useless commits. In general, keeping independent things independent tends to be A Good Idea (TM).

    Alternatively, sync the web server against your working directory with rsync, or write a script which pushes your file(s) from the dev box to your staging server and add a Makefile rule which runs your script (or calls up rsync). If you want to be really fancy, use inotify or some other file notification monitor to run your script automatically.

提交回复
热议问题