Subversion And Jenkins As A Windows Service

I have recently begun migrating a fully scripted MSBuild build to Jenkins. I am currently running Jenkins as a Windows Service and started off running it under the System account. Downloading projects from Subversion works fine when Jenkins does it using your cached credentials.

Things don’t work out so great when one of your MSBuild or Ant scripts in your project wants to download something from Subversion also. How we got here is not worth explaining, the build is complicated and there are many files packaged together. Since the build is running under the System account, there is no profile for Subversion to load for cached credentials. Having the username and password in the build script is not so great either. SVN tries to prompt for a password (you can disable this in the command line) and the build hangs. The Jenkins windows service is not able to display the prompt. You have to stop the Jenkins service and kill the svn.exe process after Jenkins hangs. Yuck.

Solution for now is to run the Jenkins service under a user account that has the cached credentials and not the System account.

More on this later when I find a better solution.

Download PDF
This entry was posted in Jenkins and tagged . Bookmark the permalink.

One Response to Subversion And Jenkins As A Windows Service

  1. Alexander Miseler says:

    Since this post featured prominently in my own searches, here is the solution:
    Open a cmd shell running as the local system account, as described here: http://stackoverflow.com/questions/77528/how-do-you-run-cmd-exe-under-the-local-system-account
    Then just execute “svn log -l1 svn://your_repo_url” or something like that and enter your credentials to store them for the local system account.

Leave a Reply

Your email address will not be published. Required fields are marked *