display web contents from svn repository
Hello, I set up a combined svn server / web server where the latter displays contents taken directly from one of the repositories. It runs fine but I would like to make it work a bit more efficiently. At the moment it works like this: 1) Both the svn repository and one checkout of it in "/example" are hosted on the same machine 2) the svn repository folder is monitored for changes by an incron job 3) when a file modification is made to the repository (by a commit for instance), incron triggers svn update /example 4) the webserver points to /example and displays /example/index.html My two questions are the following a) can I avoid the checkout altogheter and save disk space? I.e.can I configure the svn server so that I could take html pages and related images directly from the HEAD revision? b) If not, I would like to improve step 3). At the moment svn update is called tens of times for each commit (any kind of modification triggers it as I am looking at the whole folder). What would be a good file to monitor with incron in the repository that will always be modified by a new commit? Thanks for your attention, -- Asa Marco 朝
Re: display web contents from svn repository
Hello Daniel, thanks for the answer, > > If the SVN repository is available over http/https, then it should be > possible to configure mod_rewrite so that any access to the web server is > redirected to the Subversion server. > Unfortunately this is not my case but I was not much optimistic on this point > Even if you find such a file, there is always a risk a future version of > Subversion accesses the repository differently making this a fragile > solution. It is probably better to look at a post-commit repository hook, see > the SVN book [1]. The hook should trigger only once and only after completion > of commits. Nice, I was not aware of hooks and post-commit would work very nicely for the pourpose. I still had to make it work in a convoluted way since I deployed the svm server manager in an isolated container and the post-commit hook could not access directly the checkout that i need to update. Still, I could easily exploit the hook to write date and revision number in a text file accessible to both the container and the host; this file became my target to monitor with incron which is now triggered only once per commit. Thanks again, -- Marco Asa