When you install the add-on in JIRA® Cloud, a Configure button appears in the Administration / Add-ons / Manage Add-ons / Svn Gateway
In order to ask SvnGateway to retrieve the Subversion commits from the Internet, select the Public - Internet option:
In this mode, you only need to provide Svn Gateway with the following information:
Note: If you have a repository on the Internet, in which some access rules restrict access based on IP addresses, you should add:
198.27.68.25
to the list of authorized IP addresses
If you prefer sending the data to SvnGateway from your Intranet, you select the Private - Intranet option:
In this menu, you can see the key that you will have to use to configure SvnFeeder below
You can also enter a prefix for the links to the Svn Viewer application that you have on your intranet.
You will also find links to the SvnFeeder.zip and SvnFeederInstaller.exe as described below.
You will have to install a small Java program (SvnFeeder) to poll the Subversion server and send the commit comments and list of files to Svn Gateway.
The configuration is done in a simple XML file:
<svn_feeder_configuration> <svn_repository key='ip...21' stop_on_copy='1' first_rev='-1'> <url>https://xxx.example.com/svn_dev</url> <username>xx</username> <password>xx</password> </svn_repository> </svn_feeder_configuration>
Optional attributes:
In some special cases, your path inside the subversion repository may not start with revision 0 or 1, but thousands.
In this case, the lookup for revisions will fail and you will get a message like this:
ERROR SvnFeeder – Exception [svn: E160013: (path) path not found: 404 Not Found (path)
In this case, you will have to explain the feeder what is the first revision number it should take into account. This is done by adding a first_rev attribute:
<svn_feeder_configuration> <svn_repository key='ip...21' first_rev='101002' > <url>https://xxx.example.com/svn_dev</url> <username>xx</username> <password>xx</password> <nick>Dev</nick> <svn_viewer>http://10.0.0.45/SvnViewer/svn_dev/rev/</svn_viewer> </svn_repository> </svn_feeder_configuration>
SvnFeeder is launched with the following command:
java -jar SvnFeeder.jar -c configfile [-loop][-reset]
Here are the steps to install SvnFeeder under Linux or Mac OS/X:
java -jar SvnFeeder.jar -c configfile -loop &
You can also use the post-commit technique to launch this tool only after each repository commit.
See a description of the steps below on this page
You can either follow the above recipe for Linux, or download the dedicated Windows installer:
In order to automatically run the feeder when the machine boots, the easiest way is to add a task for the Windows Task Scheduler:
start -> control panel -> administration tools -> Task Scheduler
to launch the SvnFeederDaemon.cmd script
If you need to use more than one repository, you can use this button:
to add one more key to your set of keys. You will then be able to use the above setup for all the different keys you have.
If you chose to use the Intranet mode, the configuration file you write will then look like this:
<svn_feeder_configuration> <svn_repository key='ip...21'> <url>https://xxx.example.com/svn_dev</url> <username>xx</username> <password>xx</password> <nick>Dev</nick> <svn_viewer>http://10.0.0.45/SvnViewer/svn_dev/rev/</svn_viewer> </svn_repository> <svn_repository key='ip...21/2'> <url>https://xxx.example.com/svn_marketing</url> <username>xx</username> <password>xx</password> <nick>Marketing</nick> <svn_viewer>http://10.0.0.45/SvnViewer/svn_marketing/rev/</svn_viewer> </svn_repository> </svn_feeder_configuration>
The same optional attributes described above can be used for each repository
If you want the force your users to enter a commit comment containing a valid JIRA issue key in each commits, you can do so by using the following recipe
Note that our customers only experienced this with a Linux installation, as described in this tutorial. We can work with you if you need to do this under Windows.
REPOS="$1" TXN="$2" TMP=`mktemp` /usr/bin/svnlook log -t $TXN $REPOS > $TMP java -jar /pathtosvnfeeder/SvnFeeder.jar -c /pathtoconfigfile/configFile -checkjira "$REPOS" "$TMP" || exit1
<svn_feeder_configuration> <pre_commit projects='X,Y,Z' /> <svn_repository key='ip...21'> ... </svn_repository> </svn_feeder_configuration>
<svn_feeder_configuration> <svn_repository key='ip...21'> <pre_commit projects='X,Y,Z' local_svn='pathtosvn' /> ... </svn_repository> </svn_feeder_configuration>
<svn_feeder_configuration> <pre_commit projects='X,Y,Z' status='Open,In Progress' /> <svn_repository key='ip...21'> ... </svn_repository> </svn_feeder_configuration>
You can use SvnFeeder in a smarter way than the -loop attribute that will ping the subversion server every minute.
Add this code to the post-commit file on the subversion server:
java -jar /pathtosvnfeeder/SvnFeeder.jar -c /pathtoconfigfile/configFile
where:
The SvnFeeder program will only be called after a successful commit to the repository.
This will be more efficient than asking every minute, although the bandwidth of such query is really low.
Another way to feed our add-on is to send the commit details through a small REST API.
This will allow you for example to send data only on post commit hooks instead of the 1 minute polling.
Ask us to have access to the API definition.
Don't hesitate to contact us to assist in the installation.