Table of Contents |
---|
Internet
When you install the add-on in JIRA® Cloud, a Configure button appears in the Administration / Add-ons / Manage Add-ons / Svn Gateway
...
- Nick name: Allows you to differentiate between your different repositories, if you have more than one [optional].
- Subversion URL: complete path to your subversion repository.
- Username: the username to access the SVN repository
- Password: the password of that user to access the SVN repository.
- Subversion Viewer URL: this is the prefix to add before the revision number, to access your SVN viewer. Many SVN hosting system incude include a way to see details of a revision. We will add this complete URL and follow it with the revision number so that you can quickly access your SVN changes [optional].
Note: If you have a repository on the Internet, in which some access rules restrict access based on IP addresses, you should add the following IP addresses:
- 37.59.47.189
- 198.27.68.25
- 91.121.93.34
- 188.165.225.15
- 188.165.213.157
to the list of authorized IP addresses
...
Code Block | ||||
---|---|---|---|---|
| ||||
<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> |
Note that the key (ip...21 in the markup above) has to be replaced by the key assigned to your repository in the Repository Settings screen above.
Optional attributes:
- stop_on_copy: set to 1 or 0. For details about usage, please refer to Subversion documentation
- first_rev: Use this attribute if you only want to have the last part of a branch to be used for the synchronization. If the attribute is not present, SvnFeeder will take the whole branch
...
Code Block | ||||
---|---|---|---|---|
| ||||
java -jar SvnFeeder.jar -c configfile [-loop][-reset] |
...
[-cmdLine] |
Optional arguments
- -loop: when specified, SvnFeeder will stay in memory and run an update every minute
- -reset: if specified, SvnFeeder will start by requesting Svn Gateway to remove all known data about the repositories described in this configuration file.
This is useful if you change from one repository to another, or from a trunk to a branch - -cmdLine: if specified, instructs the feeder to use the command line svn command instead of the built-in (Java) library
Subversion 1.9
The Svnkit Java library that is linked with SvnFeeder is not compatible with Subversion 1.9 or higher.
If this is your case, you have to use the -cmdLine argument as described above, so that SvnFeeder calls the local command-line client program, which must be compatible with your subversion server.
Linux / Mac OS/X
Here are the steps to install SvnFeeder under Linux or Mac OS/X:
...
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.recipes:
Add this code to the pre-commit file on the subversion server:
For Linux:Code Block 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
For Windows with VisualSVN (code contributed by Antenor):
Code Block set REPOS=%1 set TXN=%2 set SVNLOOK="%VISUALSVN_SERVER%\bin\svnlook.exe" set SVNFEEDER= "pathtosvnfeeder\SvnFeeder.jar" set FEEDERCONF= "pathtoconfigfile\SvnFeederConfig.xml" set TEMP=%VISUALSVN_SERVER%jira%TXN%.log %SVNLOOK% log -t %TXN% %REPOS% > "%TEMP%" java -jar %SVNFEEDER% -c %FEEDERCONF% -checkjira "%REPOS%" "%TEMP%" if %errorlevel% gtr 0 (goto error_exit) else goto normal_exit :error_exit del "%TEMP%" exit 1 :normal_exit del "%TEMP%" exit 0
where:- pathtosvnfeeder is the absolute directory to the SvnFeeder java program
- and pathtoconfigfile the absolute directory to the SvnFeeder configuration file.
- If at least one of such key is found the commit is accepted
- otherwise it is refused.
If you have want to restrict the choice of JIRA projects to only a list of projects, you can add the following XML element in the configuration file:
Code Block <svn_feeder_configuration> <pre_commit projects='X,Y,Z' /> <svn_repository key='ip...21'> ... </svn_repository> </svn_feeder_configuration>
with X,Y,Z the list of projects you want to allow. All other projects will not be accepted. If a commit contains at least one of the authorized projects's existing issues, the commit will be accepted.
If you have many repositories, with one or more JIRA project matching each repository, you can add the following marking in the configuration file to specify the correspondence:
Code Block <svn_feeder_configuration> <svn_repository key='ip...21'> <pre_commit projects='X,Y,Z' local_svn='pathtosvn' /> ... </svn_repository> </svn_feeder_configuration>
Note that in this case the pre_commit element is inside the svn_repository element. You can specify different pre_commit elements for every subversion repository.
In order for the matching to work, you also need to add the local_svn attribute: it must contain the server local path to the repository
One of our customers has 40+ repositories, and one JIRA project for each repository. They just added a pre_commit element to each of their repository to ensure that commits cannot be done to the wrong project.Restriction on JIRA status: you can also add that only some JIRA issues status are accepted when you commit.
This is also done with a pre_commit XML element but this time with the status attribute:Code Block <svn_feeder_configuration> <pre_commit projects='X,Y,Z' status='Open,In Progress' /> <svn_repository key='ip...21'> ... </svn_repository> </svn_feeder_configuration>
In this case, only the issues with status Open or In Progress are accepted by the pre-commit. The status attribute is independent of the projects attribute. Both can be specified globally or by project.
- If you have other special requests for the pre-commit rules, we can probably manage to implement them, don't hesitate to come back to us.
...
The Java program to install is here:
View file | ||||
---|---|---|---|---|
|
it works under Windows, Linux, OS/X.
...
You can also use the Svn Activity Screen button at the right of the screen: this gives you access to the whole list of commits, more recent first:
HELP / Contact
Don't hesitate to contact us to assist in the installation.
- Email:
- MatrixRequirements Support
...
- support@matrixreq.com