0

I'm trying to make a post-commit script that will, when I push changes to the server, will update the "staging" (where the client does actually have access).

But the problem is that when the post-commit is called (I sudo su'ed to the svn user) and it gets:

[svn@beautifulserver.com: / ]# svn update /home/my-beautiful-home/www
Authentication realm: <http://svn.my-beautiful-url.com:80> BEAUTIFUL SVN
Password for 'svn': 

So the post-commit simply crashes with a:

Warning: post-commit hook failed (exit code 255) with no output.

Any idea on how to bypass this? Is there a way to specify username and password in the command line?

Thanks!

Tommy B.
  • 3,591
  • 14
  • 61
  • 105

1 Answers1

2

svn help update shows:

Global options:
  --username ARG           : specify a username ARG
  --password ARG           : specify a password ARG
  --no-auth-cache          : do not cache authentication tokens
  --non-interactive        : do no interactive prompting
  --trust-server-cert      : accept unknown SSL server certificates without
                             prompting (but only with '--non-interactive')
ColinM
  • 13,367
  • 3
  • 42
  • 49
  • OMG. RTFM to myself. Thanks for this! That did the trick: svn update /home/my-path --non-interactive --username MYUSER --password MYPASS ... But now I'd like to be able to specify something else than my own password, like a hash or something... Do you know anything about that? – Tommy B. Nov 03 '10 at 15:20
  • No, but svn 1.6 added some options for secure password caching, so depending on your needs you might be able to use secure password caching in place of specifying passwords on command lines. http://www.linuxforu.com/previews/subversion-16-security-improvements-illustrated/ – ColinM Nov 03 '10 at 15:35