You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Collin Peters <cp...@intouchtrainer.com> on 2004/07/12 23:28:16 UTC

post-commit & user logon (svn+ssh)

I have a script that is being run on post-commit.  This is a perl script 
which does some synchronization of some pictures to a web site. 
Everything works great in my script when I run it from the command line, 
but when it is run from post-commit it breaks because it seems it is not 
fully logging onto the system to run.

The main issue I'm having is with rsync.  rsync is what I'm using to 
sync the pictures to the web site.  I have ssh keys setup along with 
ssh-add, etc...  But none of that seems to work when run from post-commit.

The script still sends an email just like the commit-email.pl file.  If 
I include the username in that email, it is correct.  However, it seems 
that normal shell logon operations (such as executing .bashrc) don't get 
run from the whole commit process.

BTW, I should mention that I am using svn+ssh for everything here.  Not 
apache.  Does anyone have any pointers on getting this to work?  Is it 
as simply as an option I am missing?  Or perhaps something more advanced.

Collin

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

Re: post-commit & user logon (svn+ssh)

Posted by Collin Peters <cp...@intouchtrainer.com>.
I did a Dumper() on %ENV while testing and it only had these:
$VAR1 = 'SHLVL';
$VAR2 = '1';
$VAR3 = 'PWD';
$VAR4 = '/pub/intouch';
$VAR5 = '_';
$VAR6 = '/pub/intouch/media/intouch-post-commit.pl';

So setting the needed vars should take care of it?  What I'm most 
worried about is ssh authentication.  I'll test it out tomorrow.

Thanks,
Collin


Eric Gillespie wrote:

> Collin Peters <cp...@intouchtrainer.com> writes:
> 
> 
>>However, it seems that normal shell logon operations (such as
>>executing .bashrc) don't get run from the whole commit process.
> 
> 
> Make a post-commit like this:
> 
> #! /bin/sh
> printenv > /tmp/out
> 
> Then look at /tmp/out.  I have no idea why svn thinks it needs to
> purge the environment completely, but it does.  It has nothing to
> do with using apache or svnserve, either way your hooks are run
> in an empty (or nearly so, can't remember off the top of my head)
> environment.  So you will have to setup anything yourself, right
> down to such basics as USER, HOME, and PATH.
> 
> --  
> Eric Gillespie <*> epg@pretzelnet.org

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

Re: post-commit & user logon (svn+ssh)

Posted by Eric Gillespie <ep...@pretzelnet.org>.
Collin Peters <cp...@intouchtrainer.com> writes:

> However, it seems that normal shell logon operations (such as
> executing .bashrc) don't get run from the whole commit process.

Make a post-commit like this:

#! /bin/sh
printenv > /tmp/out

Then look at /tmp/out.  I have no idea why svn thinks it needs to
purge the environment completely, but it does.  It has nothing to
do with using apache or svnserve, either way your hooks are run
in an empty (or nearly so, can't remember off the top of my head)
environment.  So you will have to setup anything yourself, right
down to such basics as USER, HOME, and PATH.

--  
Eric Gillespie <*> epg@pretzelnet.org

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