davs
davs

Reputation: 9396

Can't execute commit to svn as root folder is forbidden

I'm trying to execute post build svn commit command in Jenkins.

I have access to http://myrepo.com/myProject ... but I haven't to http://myrepo.com/ (the access is forbidden). As a result, when I commit I'm getting the following error:

svn commit --message "Build #xx" myfile --non-interactive

svn: Commit failed (details follow):

svn: OPTIONS of 'http://myrepo.com/myProject/myfile': authorization failed: Could not
authenticate to server: rejected Basic challenge (http://myrepo.com)

Upvotes: 2

Views: 3134

Answers (1)

Dave Bacher
Dave Bacher

Reputation: 15972

When you run svn from the command line, you do not have access to the credentials stored in Jenkins.

The easiest way to make svn work from the command line is to provide the --username and --password parameters to svn in your build script.

You can also run svn as the Jenkins user and let it store the authentication in the Jenkins user's home directory. You'll have to set up the authentication yourself on each node where you need to perform commits. And it's tedious to maintain if your SSL certificate or password changes periodically. But it does keep usernames, passwords out of the build scripts.

Perhaps a plugin like SVN Publisher can help with what you're trying to accomplish.

Upvotes: 4

Related Questions