You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by "MrBr @ GMail" <mr...@gmail.com> on 2006/03/21 09:42:44 UTC

Post comit hook website update

Hi all
I'm having a little problem.
I want to update my web server with the newest revision after committing a
revision.
The problem is that keeping a working copy on the web server in not an
option.
There should be only the source code and nothing more.
The web server is off site.
The SVN server is windows+svn+Apache

Any ideas?

Re: Post comit hook website update

Posted by Nico Kadel-Garcia <nk...@comcast.net>.
Have the web server do a "wget -m http://reposite/repodir/trunk" from the source code site.

Do a checkout in a temporary repository on the server itself, and do a content push with "rsync -e ssh -avvH --delete --exclude .svvn"

The possibilites are *endless*.
  ----- Original Message ----- 
  From: MrBr @ GMail 
  To: users@subversion.tigris.org 
  Sent: Tuesday, March 21, 2006 4:42 AM
  Subject: Post comit hook website update


  Hi all
  I'm having a little problem.
  I want to update my web server with the newest revision after committing a revision.
  The problem is that keeping a working copy on the web server in not an option.
  There should be only the source code and nothing more.
  The web server is off site.
  The SVN server is windows+svn+Apache

  Any ideas?

Re: Post comit hook website update

Posted by Nico Kadel-Garcia <nk...@comcast.net>.
----- Original Message ----- 
From: "Ryan Schmidt" <su...@ryandesign.com>
To: "MrBr @ GMail" <mr...@gmail.com>
Cc: <us...@subversion.tigris.org>
Sent: Tuesday, March 21, 2006 5:44 AM
Subject: Re: Post comit hook website update


> On Mar 21, 2006, at 11:28, MrBr @ GMail wrote:
>
>> There is some problems using your idea.
>> 1) RSYNC is an Unix only program, it can't be used by Windows. Both  of 
>> my servers are windows based.
>
> Then perhaps that is a problem of your operating system and not of  the 
> idea. Perhaps if your operating system does not offer the  facilities you 
> require you should consider using a more-capable  operating system.

It's not an operating system problem. Windows has rsync and SSH and even 
Subversion tools available via the CygWin tool suite, at www.cygwin.com. 
Running an SSH server on a Windows box is one of the safer ways to send 
files to and from such as erver.

>> 2) The servers aren't on the same network so I have to use somthing  like 
>> FTP to transfer files.
>
> rsync works fine across wide-area networks, but if you prefer FTP,  that's 
> fine too. FTP is of course a wildly insecure protocol, so  you'd want to 
> use SFTP or FTP over SSH or something similar.

sftp is famous for mishandling symlinks, hardlinks, and not being able to 
*delete* old files from the sftp recipient to exactly mirror contents. I 
don't recommend it for mirroring sites.

>> I thought to use post commit script to send the file over the ftp,  but 
>> the post comit scrip is provided only with the folloing  arguments  "the 
>> path to the repository, and the new revision number  that was created" 
>> (accoring to the manual).
>> Is there any way to know wich files were changed and to transfer  them 
>> maintaing the directory sructure?
>
> Sure you can determine what files were changed. That's what the  svnlook 
> program is for.

And if you use rsync, you don't have to worry about it. Rsync will do that 
for you. 


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

Re: Post comit hook website update

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Mar 21, 2006, at 11:28, MrBr @ GMail wrote:

> There is some problems using your idea.
> 1) RSYNC is an Unix only program, it can't be used by Windows. Both  
> of my servers are windows based.

Then perhaps that is a problem of your operating system and not of  
the idea. Perhaps if your operating system does not offer the  
facilities you require you should consider using a more-capable  
operating system.


> 2) The servers aren't on the same network so I have to use somthing  
> like FTP to transfer files.

rsync works fine across wide-area networks, but if you prefer FTP,  
that's fine too. FTP is of course a wildly insecure protocol, so  
you'd want to use SFTP or FTP over SSH or something similar.


> I thought to use post commit script to send the file over the ftp,  
> but the post comit scrip is provided only with the folloing  
> arguments  "the path to the repository, and the new revision number  
> that was created" (accoring to the manual).
> Is there any way to know wich files were changed and to transfer  
> them maintaing the directory sructure?

Sure you can determine what files were changed. That's what the  
svnlook program is for.




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

RE: Post comit hook website update

Posted by Anthony Williams <an...@warwickcontrol.com>.
If you want to go down the rsync route for this (or indeed any other
problem) I use this port of rsync to windows: http://itefix.no/cwrsync/
which of course will also work between networks in the same way as FTP will.

Regards,
Anthony Williams 

-----Original Message-----
From: users-return-46793-anthony=warwickcontrol.com@subversion.tigris.org
[mailto:users-return-46793-anthony=warwickcontrol.com@subversion.tigris.org]
On Behalf Of MrBr @ GMail
Sent: 21 March 2006 10:29 AM
To: Ryan Schmidt
Cc: users@subversion.tigris.org
Subject: Re: Post comit hook website update

Hi Ryan
Thanks for a answer.
 
There is some problems using your idea.
1) RSYNC is an Unix only program, it can't be used by Windows. Both of my
servers are windows based.
2) The servers aren't on the same network so I have to use somthing like FTP
to transfer files.
 
I thought to use post commit script to send the file over the ftp, but the
post comit scrip is provided only with the folloing arguments  "the path to
the repository, and the new revision number that was created" (accoring to
the manual). 
Is there any way to know wich files were changed and to transfer them
maintaing the directory sructure?

 
On 3/21/06, Ryan Schmidt <su...@ryandesign.com> wrote: 

	On Mar 21, 2006, at 10:42, MrBr @ GMail wrote:
	
	> I want to update my web server with the newest revision after 
	> committing a revision.
	> The problem is that keeping a working copy on the web server in
not
	> an option.
	> There should be only the source code and nothing more.
	> The web server is off site. 
	> The SVN server is windows+svn+Apache
	
	So your repository server and your web server are two different
	machines. No problem. In your post-commit hook, you could use "svn
	export" to create an export of the HEAD of the repository, somewhere

	on the repository server. You could then use rsync to send only the
	relevant changes over to the web server. You would need to either do
	this entire task before exiting the post-commit hook, which may take
	some time and annoy your committers, or you need to spawn off
another 
	task in the post-commit hook, but if you do that, you must handle
	concurrency issues. (What happens if two people commit changes very
	close together such that the second commit happens while the update
	launched by the first commit is still running?) 
	
	That would work well on Linux/Unix/*BSD/OSX machines; unfortunately
I
	have no knowledge of what will or will not work on a Windows
machine.
	
	
	




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

Re: Post comit hook website update

Posted by "MrBr @ GMail" <mr...@gmail.com>.
Hi Ryan
Thanks for a answer.

There is some problems using your idea.
1) RSYNC is an Unix only program, it can't be used by Windows. Both of my
servers are windows based.
2) The servers aren't on the same network so I have to use somthing like FTP
to transfer files.

I thought to use post commit script to send the file over the ftp, but the
post comit scrip is provided only with the folloing arguments  "the path to
the repository, and the new revision number that was created" (accoring to
the manual).
Is there any way to know wich files were changed and to transfer them
maintaing the directory sructure?


On 3/21/06, Ryan Schmidt <su...@ryandesign.com> wrote:
>
> On Mar 21, 2006, at 10:42, MrBr @ GMail wrote:
>
> > I want to update my web server with the newest revision after
> > committing a revision.
> > The problem is that keeping a working copy on the web server in not
> > an option.
> > There should be only the source code and nothing more.
> > The web server is off site.
> > The SVN server is windows+svn+Apache
>
> So your repository server and your web server are two different
> machines. No problem. In your post-commit hook, you could use "svn
> export" to create an export of the HEAD of the repository, somewhere
> on the repository server. You could then use rsync to send only the
> relevant changes over to the web server. You would need to either do
> this entire task before exiting the post-commit hook, which may take
> some time and annoy your committers, or you need to spawn off another
> task in the post-commit hook, but if you do that, you must handle
> concurrency issues. (What happens if two people commit changes very
> close together such that the second commit happens while the update
> launched by the first commit is still running?)
>
> That would work well on Linux/Unix/*BSD/OSX machines; unfortunately I
> have no knowledge of what will or will not work on a Windows machine.
>
>
>

Re: Post comit hook website update

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Mar 21, 2006, at 10:42, MrBr @ GMail wrote:

> I want to update my web server with the newest revision after  
> committing a revision.
> The problem is that keeping a working copy on the web server in not  
> an option.
> There should be only the source code and nothing more.
> The web server is off site.
> The SVN server is windows+svn+Apache

So your repository server and your web server are two different  
machines. No problem. In your post-commit hook, you could use "svn  
export" to create an export of the HEAD of the repository, somewhere  
on the repository server. You could then use rsync to send only the  
relevant changes over to the web server. You would need to either do  
this entire task before exiting the post-commit hook, which may take  
some time and annoy your committers, or you need to spawn off another  
task in the post-commit hook, but if you do that, you must handle  
concurrency issues. (What happens if two people commit changes very  
close together such that the second commit happens while the update  
launched by the first commit is still running?)

That would work well on Linux/Unix/*BSD/OSX machines; unfortunately I  
have no knowledge of what will or will not work on a Windows machine.



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