no.158 Integrated Zen Path and SVN

Source: Internet
Author: User
Tags svn client

Description: The SVN integration feature configuration will be more complex, we will try to help you to configure the success of the document! If the actual configuration is not successful, you can consider looking for us to do the charge technical support.

Zen Road built with SVN integration in version 2.2, the Zen Trail is effectively linked to user code for easy viewing. This article will show you how to configure the Zen path integrated with SVN.


I. Description of the Subversion integration mechanism

The basic mechanism for subversion integration is to parse the comments when the code is submitted and to draw the corresponding story, task, BugID, and write to the Zen path database.

There are two scenarios for implementing the above functions, one scheme is to use the SVN-brought hook mechanism, when the code is submitted, trigger a hook script, and then analyze the comment, the corresponding bug, story or task ID number, and then invoke the Zen Path API, the relevant records written to the database. Another option is to get all the commit records through the SVN client software Log command, then parse, draw the corresponding ID, write to the database.

Each of the two scenarios has its own merits and demerits, and we finally chose the second option. Because the second solution debugging is better debugging, deployment is relatively convenient, but also can resolve all previous records, there is a better flexibility.


Ii. deploy the SVN command line client on the machine where Zen Road is located

The SVN command-line client refers to the SVN command that the subversion comes with. Below Windows is Svn.exe,linux, below is an svn with no suffix.

The machine where the Zen path is located can be separated from the Subversion machine and not on a single machine.

If it's a Linux machine, you need to install SVN's client. Rhel,centos can install subversion with Yum, and Debian can be installed under Apt-get.

If the newly downloaded Windows one-click installation package, the Svn.exe client is already built into it. Below the \XAMPP\SILKSVN directory.

If you are installing yourself under Windows, consider downloading the SLILKSVN client software to install.


Iii. Configuring Zen Paths about Subversion parameters

3.1 Code Location

The configuration file for the SVN module is located in zentao/module/svn/config.php. You can modify this file directly, but it is recommended that you save the changes to svn/ext/config/svn.php. This will not overwrite your profile in the future as we upgrade.

3.2 Configuration Content

There are a couple of concepts for setting up subversion parameters:

1. Location of the SVN client command.

2. Library (Repo): Multiple libraries can be configured.

3. The user name and parameters of the library.

Let's take a practical example to illustrate this.

3.2.1, find the position of the red-framed flag in the image


3.2.2 Modifying code

The notation is shown in the following example


$config->svn->client this is used to store the SVN client execution file Svn.exe path.

$config->svn->repos[$i [' Path '] this is used to store the SVN code path;

$config->svn->repos[$i [' username '] this is used to store the SVN login username, and can remain empty if you do not need to log in.

$config->svn->repos[$i [' Password '] this is used to store the SVN login password.

3.3 Configuring multiple libraries

3.3.1 Ibid, find the following code in the same file


3.3.2 Modifying code

① the Code "/ *" and "* * " Delete, the remaining changes as above, note:$i + + cannot be modified.

② If you have an SVN library, copy this code and make the same configuration.


Iv. Code Submission Comment format

When the developer submits the SVN, it needs to indicate the need for the change, or the task, or the ID of the bug in the note. For example, the following format:

bug#123,234, 1234, or the bug:123,234 1234,id list, can be separated by commas and spaces.

Story#123 task#123

A bug, story, task must be labeled. :)


V. Execute SVN sync command

5.1 Refer to Initialization management script This article initializes the command-line script.

5.2 Go to the zentao/bin/directory and execute the Syncsvn.bat or syncsvn.sh script.

5.3 Programs Run:


5.4 View the appropriate bug:


Vi. deployment of Scheduled Tasks

Once the above command has been deployed, it is good to add the command to the scheduled task. For example, it can be executed in 5 minutes.

Using Scheduled Tasks under Windows, use Crontab under Linux.


VII. Matters of attention

It is not recommended to use HTTPS or SSH protocol to access, because it is involved in the HTTPS and SSH certificate authentication interaction problems, the operation will be more troublesome.


no.158 Integrated Zen Path and SVN

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.