26/02/2011
Jenkins CI and multiple SVN credentials
The Subversion plugin for the Jenkins continuous integration server stores one credential per SVN server, that means that you cannot use job-specific users.
Hopefully I have a quick and dirty solution… by not using the Subversion plugin!
Instead, in the Jenkins job, I start the build with a Windows batch command that will do the SVN checkout, like this:
C:\scripts\svnas.foo.bat %WORKSPACE%
And the svnas.foo.bat script contains the following:
@echo off echo t | <svn_exe> co <svn_url> --user foo --password bar "%*"
(this way, the user credentials will not appear in the Jenkins log)
If you wonder what this “echo t” means, have a look at my previous post: (link)
Now, what about triggering the build automatically on SVN updates? Well, I did not need that, so I have no ready-made solution. But you should be able to find something relevant in the trigger plugins of Jenkins.
(on an unrelated side note, this is my 200th post on this blog, yay!)