I'm trying开发者_StackOverflow中文版 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)
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.
精彩评论