Vlad Krylov
Vlad Krylov

Reputation: 2744

Hudson svn credentials

How to enter subversion credentials in Hudson by shell? I've tried to generate file hudson.scm.SubversionSCM.xml in HUDSON_HOME and reload configuration, but changes weren't applied.

Upvotes: 5

Views: 9430

Answers (3)

mohit sarsar
mohit sarsar

Reputation: 189

Just start with the Hudson. Install all required Plug-Ins. Hit the link,EX:-localhost:8080/hudson Click on the add job/Create job. While choosing the options SVN will be present there,Give the SVN location. Credentials link is present out there.Click on that link. A form will get open,provide valid credentials for that location of SVN. Observe the Success message on the screen and then get back to the Create job,Complete with Job creation and Build the task.

Upvotes: 0

chris
chris

Reputation: 2627

Under Windows the global credenentials are stored under %APPDATA%\Subversion\auth. The following Groovy code helps generating these credentials:

SVNRepository repository = SVNRepositoryFactory.create(SVNURL.parseURIEncoded(url))
ISVNAuthenticationManager authManager = SVNWCUtil.createDefaultAuthenticationManager(SVNWCUtil.defaultConfigurationDirectory,"AD\user","password",true)
repository.setAuthenticationManager(authManager)
repository.getDir("", -1, null ,(Collection)null) // or some random SVN operation

Libraries used in the code above (example in Gradle):

compile 'org.tmatesoft.svnkit:org.tmatesoft.svnkit:1.7.8'
compile 'net.java.dev.jna:jna:3.4.0' // so wincrypt is available

Make sure you run the code with the same user Hudson runs on the Windows machine.

Upvotes: 0

Kohsuke Kawaguchi
Kohsuke Kawaguchi

Reputation: 3617

The easiest way to enter a credential from the shell is to use "svn" executable. Hudson recognizes the ~/.subversion/auth directory that it creates.

Upvotes: 2

Related Questions