You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Rob Brandt <br...@csd-bes.net> on 2005/11/08 18:19:22 UTC

svn update in post-commit hook

svn --newbie

I have svn up and running on my debian server, using tortoise-svn on XP
workstations.

I would like to set up something that would "publish" HEAD to a web root
directory on each commit.  This is a development server, not "live".  I've been
reading the docs and it seems like it should be straightforward, but I just
starting looking at the command line arguments and I can't think through how
this is going to work.  Specifically, permissions.  My projects need to be
password protected, and the "published" files need to have the right user/group
permissions on the server.

I have been fooling around with the command line client, and I can get
checkouts/updates to work via http://, but not file://.  I'm using AuthType:
Basic.  Doing a checkout/update as root works, but the files then are owned by
user/group root.  I see that there are switches for username/password in
checkout/update, but that seems to be for svn authorization, not system user
assignment.

Can someone point me in the right direction, or tell me I'm barking up the wrong
tree?

Lastly, it occurs to me that on the live server I can install svn as well, and
when I want to update the live server I can just svn update that as well, and
it will be sync'ed with trunk effectively.  Is that a reasonable thing, or are
there gotchas that I'm not seeing?

Thanks

Rob

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: svn update in post-commit hook

Posted by Joachim Durchholz <jo...@durchholz.org>.
Rob Brandt schrieb:
> 
> Doing a checkout/update as root works, but the files then are owned by
> user/group root.

If running the checkout script with root privilege is an option, you 
could use the chown command. Syntax:
   chown <user>:<group> file...

Disclaimer: I'm an SVN newbie myself, so this might be the worst way to 
do it. Comments welcome, so I can learn :-)

Regards,
Jo

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: svn update in post-commit hook

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Nov 8, 2005, at 23:19, Rob Brandt wrote:

> Cool: set .html files to mime-type: text/html and my simple html  
> site is
> viewable! :)
> Uncool: Doesn't work for php. :( I even tried mime-type:
> application/x-httpd-php, but that makes the browser want to  
> download the file.

Yes, it cannot work for PHP or any other scripts.

We tried to make it work by mounting the repository on the server as  
a WebDAV file system, then pointing an Apache DocumentRoot at it.  
Let's just say it was a very bad idea and was very slow. Let me save  
you some trouble and recommend you don't even think about that.


> I searched this mailing list for solutions, and while many others  
> have looked
> for an answer none have found one.
>
> I did find a reference to this though, and it looks like I can use  
> it to kill
> two birds with one stone:
>
> http://nshb.net/node/73

It's a PHP script that sends commit mails and updates a working copy.  
That sounds reasonable. I wrote a script to do that for our company,  
since it seemed to me to be less trouble than evaluating and choosing  
one of the existing scripts. :-) I soon had to disable the commit  
mail part though as it was taking too much time (I had been clever  
with colored diffs....). Even the working copy updates take some  
time. This is a problem because the Subversion client will not return  
control to the user after a commit until after the post-commit hook  
has finished running. When I have 5 minutes to rewrite it, I'll have  
the post-commit just fork off another process to do the updates and  
mails, or possibly just touch a temporary file with the revision  
number and have a periodic cronjob do the real work, so the  
programmers don't have to wait for it and can get back to work more  
quickly.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: svn update in post-commit hook

Posted by Rob Brandt <br...@csd-bes.net>.
Cool: set .html files to mime-type: text/html and my simple html site is
viewable! :)
Uncool: Doesn't work for php. :( I even tried mime-type:
application/x-httpd-php, but that makes the browser want to download the file.

I searched this mailing list for solutions, and while many others have looked
for an answer none have found one.

I did find a reference to this though, and it looks like I can use it to kill
two birds with one stone:

http://nshb.net/node/73

Rob


Quoting Paul Koning <pk...@equallogic.com>:

>>>>>> "Rob" == Rob Brandt <br...@csd-bes.net> writes:
>
> Rob> Ok....  I've used regular svn URLs to view the most recent
> Rob> files.  I was already configured for that.  My files are php;
> Rob> they are displayed as text rather than interpretted as php.  In
> Rob> fact, even my plain html files are displayed as text. Are we
> Rob> talking about different things here?
>
> Rob> I'm using v.1.1 BTW.
>
> I don't know if V1.1 makes any difference; I'm using V1.2.3.
>
> The answer is that you have to set the svn:mime-type attribute.  I use
> an auto-props section in the svn client config file for that, and I
> also set up mime types in the conversion from CVS.
>
> With that done, you'll get the expected behavior out of Apache (i.e.,
> web content acts as what you'd expect it to, not as plain text).
>
>    paul
>
>




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: svn update in post-commit hook

Posted by Paul Koning <pk...@equallogic.com>.
>>>>> "Rob" == Rob Brandt <br...@csd-bes.net> writes:

 Rob> Ok....  I've used regular svn URLs to view the most recent
 Rob> files.  I was already configured for that.  My files are php;
 Rob> they are displayed as text rather than interpretted as php.  In
 Rob> fact, even my plain html files are displayed as text. Are we
 Rob> talking about different things here?

 Rob> I'm using v.1.1 BTW.

I don't know if V1.1 makes any difference; I'm using V1.2.3.

The answer is that you have to set the svn:mime-type attribute.  I use
an auto-props section in the svn client config file for that, and I
also set up mime types in the conversion from CVS.

With that done, you'll get the expected behavior out of Apache (i.e.,
web content acts as what you'd expect it to, not as plain text).

    paul


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: svn update in post-commit hook

Posted by Rob Brandt <br...@csd-bes.net>.
Ok....

I've used regular svn URLs to view the most recent files.  I was already
configured for that.  My files are php; they are displayed as text rather than
interpretted as php.  In fact, even my plain html files are displayed 
as text. Are we talking about different things here?

I'm using v.1.1 BTW.

Rob


Quoting Paul Koning <pk...@equallogic.com>:

>>>>>> "Rob" == Rob Brandt <br...@csd-bes.net> writes:
>
> Rob> "set up Apache to server your repository" sounds really
> Rob> interesting; how do I do that?  I looked in the docs and the
> Rob> repository browsing references I see seem to refer to browsing
> Rob> the repository as if it's a client - file revisions, branches,
> Rob> the trunk, etc.  I just pointed apache to my repository dir, and
> Rob> it just shows me the repository dir structure - /conf, /dav,
> Rob> /db, etc.  So I guess I haven't set it up.
>
> That's right.
>
> Read chapter 6 of the SVN book.  Basically, you need to configure the
> mod_dav_svn module.  That teaches Apache how to interpret a Subversion
> repository.
>
> This does two things:
> 1. It lets you see the head revision as live data from any browser
> 2. It lets the svn client access the repository via http: URLs.
>
> You can fine tune the access control, play games with rewrites, and do
> all sorts of other fun things that Apache supports.
>
>    paul
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
>
>




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: svn update in post-commit hook

Posted by Paul Koning <pk...@equallogic.com>.
>>>>> "Rob" == Rob Brandt <br...@csd-bes.net> writes:

 Rob> "set up Apache to server your repository" sounds really
 Rob> interesting; how do I do that?  I looked in the docs and the
 Rob> repository browsing references I see seem to refer to browsing
 Rob> the repository as if it's a client - file revisions, branches,
 Rob> the trunk, etc.  I just pointed apache to my repository dir, and
 Rob> it just shows me the repository dir structure - /conf, /dav,
 Rob> /db, etc.  So I guess I haven't set it up.

That's right.

Read chapter 6 of the SVN book.  Basically, you need to configure the
mod_dav_svn module.  That teaches Apache how to interpret a Subversion
repository.

This does two things: 
1. It lets you see the head revision as live data from any browser
2. It lets the svn client access the repository via http: URLs.

You can fine tune the access control, play games with rewrites, and do
all sorts of other fun things that Apache supports.

    paul


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: svn update in post-commit hook

Posted by Rob Brandt <br...@csd-bes.net>.
"set up Apache to server your repository" sounds really interesting; 
how do I do
that?  I looked in the docs and the repository browsing references I 
see seem to
refer to browsing the repository as if it's a client - file revisions, 
branches,
the trunk, etc.  I just pointed apache to my repository dir, and it just shows
me the repository dir structure - /conf, /dav, /db, etc.  So I guess I haven't
set it up.

Rob

Quoting Paul Koning <pk...@equallogic.com>:

>>>>>> "Rob" == Rob Brandt <br...@csd-bes.net> writes:
>
> Rob> svn --newbie I have svn up and running on my debian server,
> Rob> using tortoise-svn on XP workstations.
>
> Rob> I would like to set up something that would "publish" HEAD to a
> Rob> web root directory on each commit.
>
> That works without any action at all if you set up Apache to server
> your repository.  Given that, regular browser access to the repository
> pathname will see the latest data.
>
> Making it look like a root is a simple ( :-) ) exercise in RewriteRule
> magic...
>
> 	paul
>
>




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: svn update in post-commit hook

Posted by Paul Koning <pk...@equallogic.com>.
>>>>> "Rob" == Rob Brandt <br...@csd-bes.net> writes:

 Rob> svn --newbie I have svn up and running on my debian server,
 Rob> using tortoise-svn on XP workstations.

 Rob> I would like to set up something that would "publish" HEAD to a
 Rob> web root directory on each commit. 

That works without any action at all if you set up Apache to server
your repository.  Given that, regular browser access to the repository
pathname will see the latest data.

Making it look like a root is a simple ( :-) ) exercise in RewriteRule
magic...

	paul


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org