This plugin adds the Subversion support (via SVNKit) to Jenkins.This plugin is bundled inside jenkins.war.
Once this plugin is installed, you'll see Subversion as one of the options in the SCM section of job configurations. See inline help for more information about how to use it.
An important note for those wanting to use client certificates to authenticate to your subversion server. Your PKCS12 cert file have a blank passphrase or a blank export password as it will cause authentication to fail. Refer to SVNKit:0000271 for more details.
You can set the proxy in C:/Users/<user>/AppData/Roaming/Subversion/servers (Windows) or ~/.subversion/servers (Linux)
(Jenkins as a service on Windows : C:\Windows\SysWOW64\config\systemprofile\AppData\Roaming\Subversion\servers)
Jenkins can poll Subversion repositories for changes, and while this is reasonably efficient, this can only happen up to every once a minute, so you may still have to wait a full minute before Jenkins detects a change.
To reduce this delay, you can set up a post commit hook so the Subversion repository can notify Jenkins whenever a change is made to that repository. To do this, put the following script in your post-commit file (in the $REPOSITORY/hooks directory):
Since wget by default retries up to 20 times when not succeeding within the given timeout, --timeout=2 on a slow SVN server may cause Jenkins to scan the repository many more times than needed, further slowing down the SVN Server which after a while makes Jenkins unresponsive.
Possible solutions to this problem are to increase the timeout, to add a lower maximum number of retries using the argument --retries=3 or to make the wget call asynchronous (and thus ignoring any communication errors) by adding 2>&1 & last on the wget call.
Having the timeout too low can also cause your commits to hang and throw either 502 errors if you are behind a proxy, or post-commit errors if not. Increasing the timeout until you no longer see wget retrying should fix the issue.
The basic script above is fine if your server does not do authentication or you have no problem providing anonymous read access to Jenkins (as well as anonymous read to all the individual jobs you want to trigger if you are using project-based matrix authorization). Here is a script that includes the more robust security concepts hinted at in the basic example.
The script above takes care of the Prevent Cross Site Request Forgery exploits option if you have it enabled on your server. If you do not have that option enabled, the extra wget call is harmless, but feel free to remove it if you do not need it. The script above also requires that you set up a .netrc file in the home directory of the user you are running subversion as (either the svnserve process or httpd). For more info on .netrc file syntax, look here. The script above makes it easy to notify multiple Jenkins servers of the same SVN commit. If you have a .netrc file, it keeps it easy even if they have different admin users set up. If you don't want to mess with a .netrc file, you could just hard-code the user and password (or API Token) info in the file and add --username=user and --password="pass" flags to the wget calls.
The above script is difficult under the Windows command processor seeing as there is no support for backtick output extraction and there is no built in wget command. Instead the following contents can be added to post-commit.bat (in the $REPOSITORY/hooks directory):
The batch file relies on the following VBScript being available in the file designated by the VBSCRIPT variable above:
JIRA JENKINS-5413 documents problems with running the SCM polling trigger on slaves. Version 1.21 of the Subversion plugin can perform the polling on the Jenkins master if the hudson.scm.SubversionSCM.pollFromMaster system property is set to true.
The Subversion SCM plugin exports the svn revisions and URLs of the build's subversion modules as environment variables. These are $SVN_REVISION_n and $SVN_URL_n, where n is the 1-based index of the module in the configuration.
For backwards compatibility if there's only a single module, its values are also exported as $SVN_REVISION and $SVN_URL.
Note that the revision number exposed is the 'last-changed' revision number of the particular directory and not the current revision of the repository. (See What are these two revision numbers in svn info?)
To connect to a Kerberos authenticated SVN repository see the Subversion Plugin HTTPS Kerberos authentication page.
Someone suggested in the Jenkins IRC channel that if you are getting an error and a long svnkit stack trace that looks like:
(2.5-beta-1 botched due to upload error)
Note: Version 2.0 contained a fix for JENKINS-18574. However, the fix caused 2 regressions, so it was reverted in this version
Version does not exist
Apache, Apache Subversion and Subversion are trademarks of the Apache Software Foundation
Skip to end of metadata Go to start of metadata