|
This plugin adds the Subversion support (via SVNKit) to Hudson. This plugin is bundled inside hudson.war if you download it from hudson-ci.org. Plugin Information
Basic UsageOnce this plugin is installed, you'll see Subversion as one of the options in the SCM. See inline help for more information about how to use it. Usage with Server CertificatesAn important note for those wanting to use client certificates to authenticate to your subversion server. Your PKCS12 cert file must not have a blank passphrase or a blank export password as it will cause authentication to fail. Refer to SVNKit:0000271 for more details. Advanced Features/ConfigurationsPost-commit hookHudson 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 Hudson detects a change. To reduce this delay, you can set up a post commit hook so the Subversion repository can notify Hudson whenever a change is made to that repository. To do this, put the following script in your post-commit file: REPOS="$1"
REV="$2"
UUID=`svnlook uuid $REPOS`
/usr/bin/wget \
--header "Content-Type:text/plain;charset=UTF-8" \
--post-data "`svnlook changed --revision $REV $REPOS`" \
--output-document "-" \
http://server/hudson/subversion/${UUID}/notifyCommit?rev=$REV
Windows specific post-commit hookThe 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: SET REPOS=%1 SET REV=%2 SET CSCRIPT=C:\WINDOWS\system32\cscript.exe SET VBSCRIPT=C:\Repositories\post-commit-hook-hudson.vbs SET SVNLOOK=C:\Subversion\svnlook.exe SET HUDSON=http://server/hudson/ "%CSCRIPT%" "%VBSCRIPT%" "%REPOS%" %2 "%SVNLOOK%" %HUDSON% The batch file relies on the following VBScript being available in the file designated by the VBSCRIPT variable above: repos = WScript.Arguments.Item(0)
rev = WScript.Arguments.Item(1)
svnlook = WScript.Arguments.Item(2)
hudson = WScript.Arguments.Item(3)
Set shell = WScript.CreateObject("WScript.Shell")
Set uuidExec = shell.Exec(svnlook & " uuid " & repos)
Do Until uuidExec.StdOut.AtEndOfStream
uuid = uuidExec.StdOut.ReadLine()
Loop
Wscript.Echo "uuid=" & uuid
Set changedExec = shell.Exec(svnlook & " changed --revision " & rev & " " & repos)
Do Until changedExec.StdOut.AtEndOfStream
changed = changed + changedExec.StdOut.ReadLine() + Chr(10)
Loop
Wscript.Echo "changed=" & changed
url = hudson + "subversion/" + uuid + "/notifyCommit?rev=" + rev
Wscript.Echo url
Set http = CreateObject("Microsoft.XMLHTTP")
http.open "POST", url, False
http.setRequestHeader "Content-Type", "text/plain;charset=UTF-8"
http.send changed
Change LogVersion 1.17 (Apr 21, 2010)
Version 1.16 (Mar 23, 2010)
Version 1.15 (Mar 22, 2010)
Version 1.14 (Mar 17, 2010)
Version 1.13 (Mar 8, 2010)
Version 1.12 (Mar 3, 2010)
Version 1.11 (Feb 11, 2010)
Version 1.10 (Jan 27, 2010)
Version 1.9 (Jan 16, 2010)
Version 1.8 (Dec 23, 2009)
Version 1.7 (Sep 3, 2009)
Version 1.6 (Aug 28, 2009)
Version 1.5 (Aug 19, 2009)
Version 1.3 (July 8, 2009)
Version 1.2 (June 24, 2009)
Version 1.0 (June 15, 2009)
|
Comments (9)
Dec 30, 2009
Dan Morrow says:
I'm trying to build a specific revision. The help says: You can also add "@NNN"...I'm trying to build a specific revision. The help says:
You can also add "@NNN" at the end of the URL to check out a specific revision number, if that's desirable
So, I set the URL to be: "https://mycompany.com/svn/SpecialProject/trunk@12345" to indicate revision 12345. Well, I'm doing that, and Hudson says: '/SpecialProject/trunk@12345' doesn't exist in the repository. Maybe you meant '/SpecialProject/trunk'?
Is there a better way to specify a revision when doing an update from Subversion, or is this bug?
Jan 06, 2010
Yossi Zach says:
AFAIK, it is a bug. You should just ignore the message. After saving the settin...AFAIK, it is a bug. You should just ignore the message.
After saving the settings Hudson will checkout the requested revision all the same.
Feb 15
Herve Quiroz says:
Just some extra information for those using LDAP authentication. I had some trou...Just some extra information for those using LDAP authentication. I had some trouble configuring the post-commit hook (403 error: authentication failure with wget). I found out the following solution:
1. retrieve a persistent authentication cookie:
(with <username> and <password> related to an existing and valid account in your LDAP server)
2. add the following as the post-commit hook:
REPOS="$1" REV="$2" UUID=`svnlook uuid $REPOS` /usr/bin/wget \ --header "Content-Type:text/plain;charset=UTF-8" \ --post-data "`svnlook changed --revision $REV $REPOS`" \ --output-document "-" \ --load-cookies /path/to/hudson-authentication-cookie \ http://server/hudson/subversion/${UUID}/notifyCommit?rev=$REVMar 11
Mark Lewis says:
For those using Windows, the same thing can be accomplished by adding an Authori...For those using Windows, the same thing can be accomplished by adding an Authorization request header to the last part of the VBScript. Just encode "<username>:<password>" in base64 for the value.
Set http = CreateObject("Microsoft.XMLHTTP") http.open "POST", url, False http.setRequestHeader "Content-Type", "text/plain;charset=UTF-8" http.setRequestHeader "Authorization", "Basic dXNlcm5hbWU6cGFzc3dvcmQ=" http.send changedMar 19
Felix Petriconi says:
According to my experience with version 1.351 the URL in the shell script must b...According to my experience with version 1.351 the URL in the shell script must be a little bit different:
http://server/subversion/${UUID}/notifyCommit?rev=$REVso without the "hudson/" part in the path.
Mar 20
Yossi Zach says:
It depends on the Hudson installation. When Hudson running in it's default conta...It depends on the Hudson installation. When Hudson running in it's default container it is running on the domain root and it does not requires the hudson/ prefix.
In more general case when Hudson is running within another container you will need the stated prefix.
Apr 26
David Aldrich says:
Version 1.17 is not appearing in Hudson's Plugin manager's 'Updates' tab as of 2...Version 1.17 is not appearing in Hudson's Plugin manager's 'Updates' tab as of 26 April 2010.
Apr 27
Jaakko Aro says:
Would it be possible to have an option that this plugin does not store auth cach...Would it be possible to have an option that this plugin does not store auth cache to .subversion/auth/svn.simple ?
I'm thinking a way that on could configure the plugin to all project that it always runs like (for example) svn co https://here.is.url.to.svn/trunk --no-auth-cache --username foo --password bar
So all authentication data would be stored in some hudson / plugin configuration file and there would be no need to access the home -folder.
This feature would really help us since we have almost 1000 builds using svn and the home -folder is mounted trough NFS. Sometimes the NFS doesn't reply fast enough so the plugin can't read the data from ~/.subversion/auth/svn.simple and the build fails for no reason..
May 05
Axel Heider says:
In a DOS batch, you can do this to get command output in a variable without usin...In a DOS batch, you can do this to get command output in a variable without using a tmp file:
However, the whole POST request could get too big ich many files have changes. Thus I wonder, why a simple GET-request with
http://server/hudson/subversion/${UUID}/notifyCommit?rev=${REV}would be enough. Hudson get the file list internally as well, as it gets the new revision number anyway.
What does Hudson do when I send one POST request per changed file in the post-commit hook?
would be the side-