You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by smakawhat <sm...@yahoo.com> on 2007/03/09 19:39:09 UTC

hook deployment script

Hey all, 
   
  I already emailed the list in regards to some basic concepts of subversion.  I am at the point where I am discovering that in order to get the changes made commited to the repository I will need to use something like a post commit hook script.
   
  My understanding from what I have been googling is you can write these in any language just make it executable.  I notice I think most people tend to write them in PERL.
   
  My question is how do I know what to copy in the script cause I want to copy only what is new.  Being doing some Googlin and just finding lots of email examples but nothing related to copying (kind of like deploying), or use of variables, syntax meaning etc...
   
  If anyone has any examples, a different idea on how to do this, or point me in the correct direction on this I'd appreciate it.  This is for a Windows environment.
   
  Thanks.

 
---------------------------------
Don't be flakey. Get Yahoo! Mail for Mobile and 
always stay connected to friends.

Re: hook deployment script [NTVDM error]

Posted by smakawhat <sm...@yahoo.com>.
I appreciate everyone's help on getting me goin..
   
  I am getting the NTVDM has encountered a system error, The Handle is invalid every time I try something new - error message.
   
  It looks like this is a patch issue ?, this script is running on a Windows 2003 server so it shouldn't be.

Paul <al...@gmail.com> wrote:
  You also need to tell subversion to UPDATE the working copy

C:\Path\To\svn.exe update C:\Documents\MyWebSite


 
---------------------------------
Never miss an email again!
Yahoo! Toolbar alerts you the instant new Mail arrives. Check it out.

Re: hook deployment script [trying svn up]

Posted by Paul <al...@gmail.com>.
You also need to tell subversion to UPDATE the working copy

C:\Path\To\svn.exe update C:\Documents\MyWebSite

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

Re: hook deployment script [trying svn up]

Posted by Neil Obremski <we...@gmail.com>.
For a post-commit hook script on Windows, I suggest you have a separate
Scheduled Task setup to do it.  You can set it to run on demand and then in
a post-commit.CMD launch it like so:

    SCHTASKS /Run /TN "Name of task"

Scheduled Tasks can be launched by the LOCAL SYSTEM account that Apache runs
under, but have their own set of credentials to use.  This way you don't
have to run Apache under a domain account and if the task takes a long time,
it won't tie up Apache.

One caveat, since you can't pass parameters to the scheduled task you'll
need to have it get its information (repository location, revision #) from
some other place.  What I've done in these cases is have the
post-commit.CMDdump a flat file into a specific directory.  The
scheduled task can then
look in this directory for files to serve as "things to do".  Two nice side
effects of this is 1.) you can test the scheduled task without commits, and
2.) you can move the files to a "log" folder afterwards to keep track of
what's been done.

Things are simpler in your case if all you want to do is run SVN UPDATE from
a specific repository to a working copy, because you can write it with the
hard-coded values and not need parameters.

For more info on using SCHTASKS, or other command-line tricks on Windows, I
suggest starting at http://www.ss64.com/.


On 3/13/07, Ryan Schmidt <su...@ryandesign.com> wrote:
>
> On Mar 12, 2007, at 09:21, smakawhat wrote:
>
> >> > My understanding from what I have been googling is you can write
> >> > these in any language just make it executable. I notice I think
> >> > most people tend to write them in PERL.
> >> >
> >> > My question is how do I know what to copy in the script cause I
> >> > want to copy only what is new. Being doing some Googlin and just
> >> > finding lots of email examples but nothing related to copying (kind
> >> > of like deploying), or use of variables, syntax meaning etc...
> >>
> >> Your post-commit hook is given the path to the repository and the
> >> revision number. You can pass that information to "svnlook changed"
> >> to determine what changed.
> >>
> >> Rather than writing the rather complicated script needed to properly
> >> handle additions, modifications and removals of files and directories
> >> in this fashion, you could just make the directory on the server a
> >> working copy, and issue an "svn up" command in the post-commit hook
> >> to get it updated.
> >
> > I decided to go with the idea of making a working copy in the
> > website development server.  In order to do this do I had to
> > recreate a new folder and rename it cause it was what I originally
> > imported.
> >
> > I took my local copy on my workstation, commited the changes.  I
> > went to a command prompt first and used the svn up command to see
> > if the file in the repository would transfer up.  I typed in C:\svn
> > up but I got the message:  Skipped ','
> >
> > Any ideas?
>
> So you have a working copy on the server somewhere, which is used to
> serve the web site. Your web server's configuration files point at
> this working copy. The working copy is in, let's say, C:\Documents
> \MyWebSite, because you ran, say, "svn checkout $REPO/path/to/
> mywebsite/trunk C:\Documents\MyWebSite"
>
> Then your post-commit hook should contain the line "C:\Path\To
> \svn.exe C:\Documents\MyWebSite"
>
>
> --
>
> To reply to the mailing list, please use your mailer's Reply To All
> function
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
>
>

Re: hook deployment script [trying svn up]

Posted by Andy Levy <an...@gmail.com>.
On 3/13/07, smakawhat <sm...@yahoo.com> wrote:
> the error I am seeing when I run the script:
>
> SET out=//OurServer/D$/folder/WorkCopyonWebServer
>
> svn update %out%
>
> from another workstation I get the errors:
>
> Unable to open an ra_local session to URL
> Unable to open repository 'file:///D:/folder/therepository
> Can't open file D:\folder\therepository\format the device is not ready.
>
> I am not using Apache, and I have not connected my working copies by any
> other method than the file:/// method.  I do have the svnserve service
> running and tried to see if I could connect with the svn: protocol but I
> couldn't get it to work.

If you're using file:///, then your hook script is running on your
local machine, with your credentials.

Why are you using forward slashes in your UNC path? They should be backslashes.

> Andy Levy <an...@gmail.com> wrote:
> Hook scripts run with a nearly-empty environment and under the user
> account that your server process runs under. So, you must be sure to
> A) use full paths to executables, file locations, etc. and B) grant
> access for that account to any resources which your script requires.
> Do not count on mapped drives unless you map them in your hook script.
>
> I don't recall if you told us how you're serving the repository. If
> you're serving via Apache, it typically runs under the local system
> account on Windows, so you'd have to give that account rights to that
> UNC path. It would be a good idea to create a domain account with
> limited rights to run Apache under in this case so that it can access
> your UNC paths for updates and you don't have to mess with granting
> server A's system account rights on server B..
>
> On 3/13/07, smakawhat wrote:
> > I also tried using a UNC path but it's the same issue.
> >
> > smakawhat wrote:
> >
> > Well I got the script working just by using an svn update D:\mypath
> > statement.
> >
> > However it doesn't transfer unless I run it from the actual server. I am
> > thinking because I have a drive letter specified in the path. I know that
> > it mentions environment variables aren't set in hook scripts but this
> > shouldn't matter cause I wrote an explicit path.
> >
> >
> > Andy Levy wrote:
> > On 3/13/07, smakawhat wrote:
> > > so this line: (including the correct paths)
> > >
> > > "C:\Path\To\svn.exe C:\Documents\MyWebSite"
> > >
> > > in the hook script is all I need for working copies from developers to
> > > transfer over to the webserver automatically?
> > >
> > > The hook file should be in the hooks directory of the repository and in
> > this
> > > case should be and executable say changing it to 'post-commit.exe' woud
> > > execute it?
> >
> > You cannot just change a file's extension to .exe to make it
> > executable. You're talking about writing a batch script, which in
> > Windows 2000/2003 needs either a .bat or .cmd extension.
> >
> > Naming a batch script .exe is probably what's causing your NTVDM issue.
> >
> > Please STOP changing your subject line on every post, as it is
> > breaking some peoples' mail clients (GMail for example) and makes in
> > general makes it harder to track the discussion.
> >
> >
> > ________________________________
> > No need to miss a message. Get email on-the-go
> > with Yahoo! Mail for Mobile. Get started.
> >
> >
> > ________________________________
> > TV dinner still cooling?
> > Check out "Tonight's Picks" on Yahoo! TV.
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail:
> users-help@subversion.tigris.org
>
>
>
>
>  ________________________________
> We won't tell. Get more on shows you hate to love
> (and love to hate): Yahoo! TV's Guilty Pleasures list.
>
>

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

Re: hook deployment script [trying svn up]

Posted by smakawhat <sm...@yahoo.com>.
the error I am seeing when I run the script:
   
  SET out=//OurServer/D$/folder/WorkCopyonWebServer
   
  svn update %out%
   
  from another workstation I get the errors:
   
  Unable to open an ra_local session to URL
  Unable to open repository 'file:///D:/folder/therepository
  Can't open file D:\folder\therepository\format the device is not ready.
   
  I am not using Apache, and I have not connected my working copies by any other method than the file:/// method.  I do have the svnserve service running and tried to see if I could connect with the svn: protocol but I couldn't get it to work.

Andy Levy <an...@gmail.com> wrote:
  Hook scripts run with a nearly-empty environment and under the user
account that your server process runs under. So, you must be sure to
A) use full paths to executables, file locations, etc. and B) grant
access for that account to any resources which your script requires.
Do not count on mapped drives unless you map them in your hook script.

I don't recall if you told us how you're serving the repository. If
you're serving via Apache, it typically runs under the local system
account on Windows, so you'd have to give that account rights to that
UNC path. It would be a good idea to create a domain account with
limited rights to run Apache under in this case so that it can access
your UNC paths for updates and you don't have to mess with granting
server A's system account rights on server B..

On 3/13/07, smakawhat wrote:
> I also tried using a UNC path but it's the same issue.
>
> smakawhat wrote:
>
> Well I got the script working just by using an svn update D:\mypath
> statement.
>
> However it doesn't transfer unless I run it from the actual server. I am
> thinking because I have a drive letter specified in the path. I know that
> it mentions environment variables aren't set in hook scripts but this
> shouldn't matter cause I wrote an explicit path.
>
>
> Andy Levy wrote:
> On 3/13/07, smakawhat wrote:
> > so this line: (including the correct paths)
> >
> > "C:\Path\To\svn.exe C:\Documents\MyWebSite"
> >
> > in the hook script is all I need for working copies from developers to
> > transfer over to the webserver automatically?
> >
> > The hook file should be in the hooks directory of the repository and in
> this
> > case should be and executable say changing it to 'post-commit.exe' woud
> > execute it?
>
> You cannot just change a file's extension to .exe to make it
> executable. You're talking about writing a batch script, which in
> Windows 2000/2003 needs either a .bat or .cmd extension.
>
> Naming a batch script .exe is probably what's causing your NTVDM issue.
>
> Please STOP changing your subject line on every post, as it is
> breaking some peoples' mail clients (GMail for example) and makes in
> general makes it harder to track the discussion.
>
>
> ________________________________
> No need to miss a message. Get email on-the-go
> with Yahoo! Mail for Mobile. Get started.
>
>
> ________________________________
> TV dinner still cooling?
> Check out "Tonight's Picks" on Yahoo! TV.
>
>

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



 
---------------------------------
We won't tell. Get more on shows you hate to love
(and love to hate): Yahoo! TV's Guilty Pleasures list.

Re: hook deployment script [trying svn up]

Posted by Andy Levy <an...@gmail.com>.
Hook scripts run with a nearly-empty environment and under the user
account that your server process runs under. So, you must be sure to
A) use full paths to executables, file locations, etc. and B) grant
access for that account to any resources which your script requires.
Do not count on mapped drives unless you map them in your hook script.

I don't recall if you told us how you're serving the repository. If
you're serving via Apache, it typically runs under the local system
account on Windows, so you'd have to give that account rights to that
UNC path. It would be a good idea to create a domain account with
limited rights to run Apache under in this case so that it can access
your UNC paths for updates and you don't have to mess with granting
server A's system account rights on server B..

On 3/13/07, smakawhat <sm...@yahoo.com> wrote:
> I also tried using a UNC path but it's the same issue.
>
> smakawhat <sm...@yahoo.com> wrote:
>
> Well I got the script working just by using an svn update D:\mypath
> statement.
>
> However it doesn't transfer unless I run it from the actual server.  I am
> thinking because I have a drive letter specified in the path.  I know that
> it mentions environment variables aren't set in hook scripts but this
> shouldn't matter cause I wrote an explicit path.
>
>
> Andy Levy <an...@gmail.com> wrote:
> On 3/13/07, smakawhat wrote:
> > so this line: (including the correct paths)
> >
> > "C:\Path\To\svn.exe C:\Documents\MyWebSite"
> >
> > in the hook script is all I need for working copies from developers to
> > transfer over to the webserver automatically?
> >
> > The hook file should be in the hooks directory of the repository and in
> this
> > case should be and executable say changing it to 'post-commit.exe' woud
> > execute it?
>
> You cannot just change a file's extension to .exe to make it
> executable. You're talking about writing a batch script, which in
> Windows 2000/2003 needs either a .bat or .cmd extension.
>
> Naming a batch script .exe is probably what's causing your NTVDM issue.
>
> Please STOP changing your subject line on every post, as it is
> breaking some peoples' mail clients (GMail for example) and makes in
> general makes it harder to track the discussion.
>
>
>  ________________________________
>  No need to miss a message. Get email on-the-go
> with Yahoo! Mail for Mobile. Get started.
>
>
>  ________________________________
> TV dinner still cooling?
> Check out "Tonight's Picks" on Yahoo! TV.
>
>

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

Re: hook deployment script [trying svn up]

Posted by smakawhat <sm...@yahoo.com>.
I also tried using a UNC path but it's the same issue.

smakawhat <sm...@yahoo.com> wrote:    Well I got the script working just by using an svn update D:\mypath statement.
   
  However it doesn't transfer unless I run it from the actual server.  I am thinking because I have a drive letter specified in the path.  I know that it mentions environment variables aren't set in hook scripts but this shouldn't matter cause I wrote an explicit path.
   
  
Andy Levy <an...@gmail.com> wrote:
  On 3/13/07, smakawhat wrote:
> so this line: (including the correct paths)
>
> "C:\Path\To\svn.exe C:\Documents\MyWebSite"
>
> in the hook script is all I need for working copies from developers to
> transfer over to the webserver automatically?
>
> The hook file should be in the hooks directory of the repository and in this
> case should be and executable say changing it to 'post-commit.exe' woud
> execute it?

You cannot just change a file's extension to .exe to make it
executable. You're talking about writing a batch script, which in
Windows 2000/2003 needs either a .bat or .cmd extension.

Naming a batch script .exe is probably what's causing your NTVDM issue.

Please STOP changing your subject line on every post, as it is
breaking some peoples' mail clients (GMail for example) and makes in
general makes it harder to track the discussion.

    
---------------------------------
  No need to miss a message. Get email on-the-go 
with Yahoo! Mail for Mobile. Get started.

 
---------------------------------
TV dinner still cooling?
Check out "Tonight's Picks" on Yahoo! TV.

Re: hook deployment script [trying svn up]

Posted by smakawhat <sm...@yahoo.com>.
Well I got the script working just by using an svn update D:\mypath statement.
   
  However it doesn't transfer unless I run it from the actual server.  I am thinking because I have a drive letter specified in the path.  I know that it mentions environment variables aren't set in hook scripts but this shouldn't matter cause I wrote an explicit path.
   
  
Andy Levy <an...@gmail.com> wrote:
  On 3/13/07, smakawhat wrote:
> so this line: (including the correct paths)
>
> "C:\Path\To\svn.exe C:\Documents\MyWebSite"
>
> in the hook script is all I need for working copies from developers to
> transfer over to the webserver automatically?
>
> The hook file should be in the hooks directory of the repository and in this
> case should be and executable say changing it to 'post-commit.exe' woud
> execute it?

You cannot just change a file's extension to .exe to make it
executable. You're talking about writing a batch script, which in
Windows 2000/2003 needs either a .bat or .cmd extension.

Naming a batch script .exe is probably what's causing your NTVDM issue.

Please STOP changing your subject line on every post, as it is
breaking some peoples' mail clients (GMail for example) and makes in
general makes it harder to track the discussion.


 
---------------------------------
No need to miss a message. Get email on-the-go 
with Yahoo! Mail for Mobile. Get started.

Re: hook deployment script [trying svn up]

Posted by Andy Levy <an...@gmail.com>.
On 3/13/07, smakawhat <sm...@yahoo.com> wrote:
> so this line:  (including the correct paths)
>
> "C:\Path\To\svn.exe C:\Documents\MyWebSite"
>
> in the hook script is all I need for working copies from developers to
> transfer over to the webserver automatically?
>
> The hook file should be in the hooks directory of the repository and in this
> case should be and executable say changing it to 'post-commit.exe' woud
> execute it?

You cannot just change a file's extension to .exe to make it
executable. You're talking about writing a batch script, which in
Windows 2000/2003 needs either a .bat or .cmd extension.

Naming a batch script .exe is probably what's causing your NTVDM issue.

Please STOP changing your subject line on every post, as it is
breaking some peoples' mail clients (GMail for example) and makes in
general makes it harder to track the discussion.

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

Re: hook deployment script [trying svn up]

Posted by smakawhat <sm...@yahoo.com>.
so this line:  (including the correct paths)
   
  "C:\Path\To\svn.exe C:\Documents\MyWebSite"

  in the hook script is all I need for working copies from developers to transfer over to the webserver automatically?
   
  The hook file should be in the hooks directory of the repository and in this case should be and executable say changing it to 'post-commit.exe' woud execute it?
   
  I'll give this a shot.

Ryan Schmidt <su...@ryandesign.com> wrote:
  On Mar 12, 2007, at 09:21, smakawhat wrote:

>> > My understanding from what I have been googling is you can write
>> > these in any language just make it executable. I notice I think
>> > most people tend to write them in PERL.
>> >
>> > My question is how do I know what to copy in the script cause I
>> > want to copy only what is new. Being doing some Googlin and just
>> > finding lots of email examples but nothing related to copying (kind
>> > of like deploying), or use of variables, syntax meaning etc...
>>
>> Your post-commit hook is given the path to the repository and the
>> revision number. You can pass that information to "svnlook changed"
>> to determine what changed.
>>
>> Rather than writing the rather complicated script needed to properly
>> handle additions, modifications and removals of files and directories
>> in this fashion, you could just make the directory on the server a
>> working copy, and issue an "svn up" command in the post-commit hook
>> to get it updated.
>
> I decided to go with the idea of making a working copy in the 
> website development server. In order to do this do I had to 
> recreate a new folder and rename it cause it was what I originally 
> imported.
>
> I took my local copy on my workstation, commited the changes. I 
> went to a command prompt first and used the svn up command to see 
> if the file in the repository would transfer up. I typed in C:\svn 
> up but I got the message: Skipped ','
>
> Any ideas?

So you have a working copy on the server somewhere, which is used to 
serve the web site. Your web server's configuration files point at 
this working copy. The working copy is in, let's say, C:\Documents 
\MyWebSite, because you ran, say, "svn checkout $REPO/path/to/ 
mywebsite/trunk C:\Documents\MyWebSite"

Then your post-commit hook should contain the line "C:\Path\To 
\svn.exe C:\Documents\MyWebSite"


-- 

To reply to the mailing list, please use your mailer's Reply To All 
function




 
---------------------------------
TV dinner still cooling?
Check out "Tonight's Picks" on Yahoo! TV.

Re: hook deployment script [trying svn up]

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Mar 12, 2007, at 09:21, smakawhat wrote:

>> > My understanding from what I have been googling is you can write
>> > these in any language just make it executable. I notice I think
>> > most people tend to write them in PERL.
>> >
>> > My question is how do I know what to copy in the script cause I
>> > want to copy only what is new. Being doing some Googlin and just
>> > finding lots of email examples but nothing related to copying (kind
>> > of like deploying), or use of variables, syntax meaning etc...
>>
>> Your post-commit hook is given the path to the repository and the
>> revision number. You can pass that information to "svnlook changed"
>> to determine what changed.
>>
>> Rather than writing the rather complicated script needed to properly
>> handle additions, modifications and removals of files and directories
>> in this fashion, you could just make the directory on the server a
>> working copy, and issue an "svn up" command in the post-commit hook
>> to get it updated.
>
> I decided to go with the idea of making a working copy in the  
> website development server.  In order to do this do I had to  
> recreate a new folder and rename it cause it was what I originally  
> imported.
>
> I took my local copy on my workstation, commited the changes.  I  
> went to a command prompt first and used the svn up command to see  
> if the file in the repository would transfer up.  I typed in C:\svn  
> up but I got the message:  Skipped ','
>
> Any ideas?

So you have a working copy on the server somewhere, which is used to  
serve the web site. Your web server's configuration files point at  
this working copy. The working copy is in, let's say, C:\Documents 
\MyWebSite, because you ran, say, "svn checkout $REPO/path/to/ 
mywebsite/trunk C:\Documents\MyWebSite"

Then your post-commit hook should contain the line "C:\Path\To 
\svn.exe C:\Documents\MyWebSite"


-- 

To reply to the mailing list, please use your mailer's Reply To All  
function


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

Re: hook deployment script [trying svn up]

Posted by smakawhat <sm...@yahoo.com>.
I decided to go with the idea of making a working copy in the website development server.  In order to do this do I had to recreate a new folder and rename it cause it was what I originally imported.
   
  I took my local copy on my workstation, commited the changes.  I went to a command prompt first and used the svn up command to see if the file in the repository would transfer up.  I typed in C:\svn up but I got the message:  Skipped ','
   
  Any ideas? 
   
  Thanks for your patience on this. 
  
Ryan Schmidt <su...@ryandesign.com> wrote:
  On Mar 9, 2007, at 13:39, smakawhat wrote:

> I already emailed the list in regards to some basic concepts of 
> subversion. I am at the point where I am discovering that in order 
> to get the changes made commited to the repository I will need to 
> use something like a post commit hook script.

Maybe you just mistyped, but to make sure: when you commit, the 
changes are made to the repository. If you then want those changes to 
be copied to a real folder on the server, for example because you 
want to serve it as a web page, then yes, you need to write a post- 
commit hook to do that.


> My understanding from what I have been googling is you can write 
> these in any language just make it executable. I notice I think 
> most people tend to write them in PERL.
>
> My question is how do I know what to copy in the script cause I 
> want to copy only what is new. Being doing some Googlin and just 
> finding lots of email examples but nothing related to copying (kind 
> of like deploying), or use of variables, syntax meaning etc...

Your post-commit hook is given the path to the repository and the 
revision number. You can pass that information to "svnlook changed" 
to determine what changed.

Rather than writing the rather complicated script needed to properly 
handle additions, modifications and removals of files and directories 
in this fashion, you could just make the directory on the server a 
working copy, and issue an "svn up" command in the post-commit hook 
to get it updated.


-- 

To reply to the mailing list, please use your mailer's Reply To All 
function




 
---------------------------------
8:00? 8:25? 8:40?  Find a flick in no time
 with theYahoo! Search movie showtime shortcut.

Re: hook deployment script

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Mar 9, 2007, at 13:39, smakawhat wrote:

> I already emailed the list in regards to some basic concepts of  
> subversion.  I am at the point where I am discovering that in order  
> to get the changes made commited to the repository I will need to  
> use something like a post commit hook script.

Maybe you just mistyped, but to make sure: when you commit, the  
changes are made to the repository. If you then want those changes to  
be copied to a real folder on the server, for example because you  
want to serve it as a web page, then yes, you need to write a post- 
commit hook to do that.


> My understanding from what I have been googling is you can write  
> these in any language just make it executable.  I notice I think  
> most people tend to write them in PERL.
>
> My question is how do I know what to copy in the script cause I  
> want to copy only what is new.  Being doing some Googlin and just  
> finding lots of email examples but nothing related to copying (kind  
> of like deploying), or use of variables, syntax meaning etc...

Your post-commit hook is given the path to the repository and the  
revision number. You can pass that information to "svnlook changed"  
to determine what changed.

Rather than writing the rather complicated script needed to properly  
handle additions, modifications and removals of files and directories  
in this fashion, you could just make the directory on the server a  
working copy, and issue an "svn up" command in the post-commit hook  
to get it updated.


-- 

To reply to the mailing list, please use your mailer's Reply To All  
function


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

Re: hook deployment script

Posted by Jan Hendrik <ja...@myrealbox.com>.
Concerning hook deployment script
smakawhat wrote on 9 Mar 2007, 11:39, at least in part:

> Hey all, 
> 
>   I already emailed the list in regards to some basic concepts of
>   subversion.  I am at the point where I am discovering that in order
>   to get the changes made commited to the repository I will need to
>   use something like a post commit hook script.
> 
>   My understanding from what I have been googling is you can write
>   these in any language just make it executable.  I notice I think
>   most people tend to write them in PERL.
> 
>   My question is how do I know what to copy in the script cause I want
>   to copy only what is new.  Being doing some Googlin and just finding
>   lots of email examples but nothing related to copying (kind of like
>   deploying), or use of variables, syntax meaning etc...
> 
>   If anyone has any examples, a different idea on how to do this, or
>   point me in the correct direction on this I'd appreciate it.  This
>   is for a Windows environment.

I have not done this actually, but the post-commit hook knows the 
revision number of the commit, which in turn can be used for 
svnlook to serve a list files modified/deleted/added in that specific 
commit.  This list of course can then be parsed by your script.  I 
am not sure if there is a Perl module for directly working on SVN 
repositories, so you may have to use an OS command for svnlook 
(Python: os.system("svnlook changed -r xxx")).

JH

---------------------------------------
Freedom quote:

     If some among you fear taking a stand
     because you are afraid of reprisals
     from customers, clients, or even government,
     recognize that you are just feeding the crocodile
     hoping he'll eat you last.
               -- Ronald Reagan

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