SVN Access - Xyna-Factory/xyna GitHub Wiki
SVN Access is a development feature used for tighter integration with an Integrated development environment (IDE) like Eclipse and also to provide a SVN-based backup mechanism for modeling changes. It can be individually configured for each Workspace.
SVN Access is split into two parts: Code Access and 'XMOM Access.
Instead of using Ant to build and deploy new implementations of plugins (Coded Services, Triggers, Filters) with Code Access, any changes can just be committed to SVN. Xyna Factory automatically performs the building process and deployment. This works by using SVN Hooks (see below).
In the other direction, it's not necessary to manually download new Coded Services or to update JAR files upon changes. Whenever necessary, Xyna Factory commits changes to SVN, so that the Eclipse developer only needs to update the project in order to handle the changes.
All XMOM changes will be automatically committed to SVN. It's not designed to have multiple Xyna Factory instances committing the same XMOM Objects. XMOM Access also stores all Application Definition related content, such that the Application Definitions can be restored at any point in time later on. In particular, all Order Type configuration is stored.
The SVN daemon is expected to be running with -r <path>
.
On the SVN server, the SVN Hook Manager service has to be installed in order to communicate with Xyna Factory instances. The SVN Hook Manager manages the SVN Hooks necessary for a Xyna Factory instance to detect manual changes made by developers. It is a requirement even without the usage of Code Access. The SVN Hook Manager publishes a management interface allowing Xyna Factory instances to register themselves.
The following steps describe the SVN Hook Manager's installation:
- Extract the file
components/xdev/codeaccess/svn/hooks/SVNHookManager/SVNHookManager.zip
from a Xyna Factory delivery to a directory on the SVN server, e.g./opt/SVNHookManager
- The SVNHookManager.zip file contains the following files:
- SVNHookManager.jar: SVN Hook Manager; Java program, listening to a port and supporting the commands createhook and removehook
- createhook.sh: Creates a new hook inside the hooks configuration file
- removehook.sh: Removes a hook from the hooks configuration file
- notifyfactory.sh: Notifies the Xyna Factory instances configured in the hooks configuration file on every SVN commit
- The hooks are integrated into the SVN hook system by adding the following line (depending on the chosen path and file name in the steps above) to the SVN's post-commit hook, e.g.
/usr/local/svn/repos/hooks/post-commit
:
$HOOKMANAGER/notifyfactory.sh "$REPOS" "$REV"
- Create the hooks configuration file
factoryhooks.txt
in the$SVN_REPOSITORY/hooks
directory with the follwing content:
FACTORY_HOOKS
- Start the SVN Hook Manager from within its installation directory. The following parameters are expected:
- <hostname/ip></hostname/ip>, <port></port>: Address of the management interface of the SVN Hook Manager.
- <repository-config></repository-config>: (<repository></repository> , <local></local> ;)+
java -classpath SVNHookManager.jar com.gip.xyna.xdev.codeaccess.svn.hooks.SVNHookManager 10.0.10.100 1237 "svn://svn, /usr/local/svn/repos/hooks/factoryhooks.txt; svn://svn2, /usr/local/svn/repos2/hooks/factoryhooks.txt;"
- Open the SVN Hook Manager's management interface port inside the firewall settings
- In order to access the SVN server an SVN client has to be installed on the machine running the Xyna Factory (cf. fig. 1 (5.))
Example: On Red Hat Enterprise Linux runyum install subversion
- Set the following Xyna Properties to configure the UDP endpoint the Hook Listener listens to notifications from the SVN Hooks mechanism (cf. fig. 1 (3.)). These configuration changes require a factory restart to be activated:
-
xyna.xdev.xlibdev.codeaccess.svn.hooklistener.ip
: IP or hostname or address defined by./xynafactory.sh &amp;amp&#59;amp&amp;&#35;59&#59;&amp;amp&#59;&amp;&#35;35&#59;35&amp;&#35;59&#59;39&amp;amp&#59;&amp;&#35;35&#59;59&amp;&#35;59&#59;&amp;amp&#59;amp&amp;&#35;59&#59;&amp;amp&#59;&amp;&#35;35&#59;35&amp;&#35;59&#59;39&amp;amp&#59;&amp;&#35;35&#59;59&amp;&#35;59&#59;&amp;amp&#59;amp&amp;&#35;59&#59;&amp;amp&#59;&amp;&#35;35&#59;35&amp;&#35;59&#59;39&amp;amp&#59;&amp;&#35;35&#59;59&amp;&#35;59&#59;defineip&amp;amp&#59;amp&amp;&#35;59&#59;&amp;amp&#59;&amp;&#35;35&#59;35&amp;&#35;59&#59;39&amp;amp&#59;&amp;&#35;35&#59;59&amp;&#35;59&#59;&amp;amp&#59;amp&amp;&#35;59&#59;&amp;amp&#59;&amp;&#35;35&#59;35&amp;&#35;59&#59;39&amp;amp&#59;&amp;&#35;35&#59;59&amp;&#35;59&#59;&amp;amp&#59;amp&amp;&#35;59&#59;&amp;amp&#59;&amp;&#35;35&#59;35&amp;&#35;59&#59;39&amp;amp&#59;&amp;&#35;35&#59;59&amp;&#35;59&#59;
of the local address, where the SVN Hooks should dispatch to. default: localhost -
xyna.xdev.xlibdev.codeaccess.svn.hooklistener.port
: Corresponding local port. default: 1239
-
- Open the Hook Listeners's port inside the firewall settings
Switch to the Workspaces section of the Xyna Factory Manager and press the + button to add a new Workspace. Define a name for the new Workspace and set the parameter for the SVN connection as follows:
- SVN Server Name/IP: Hostname/IP of the SVN server
-
Path in SVN: Path pointing to an existing root directory in SVN where the Workspace should commit changes. Example:
trunk/&amp;amp&#59;amp&amp;&#35;59&#59;lt&amp;amp&#59;&amp;&#35;35&#59;59&amp;&#35;59&#59;projectName&amp;amp&#59;amp&amp;&#35;59&#59;gt&amp;amp&#59;&amp;&#35;35&#59;59&amp;&#35;59&#59;
- Username: SVN Username that should be used by Xyna Factory to commit changes.
- Password: Corresponding password
- Hook Manager Port: SVN Hook Manager's management interface port (e.g. 1237, see above)
-
Base directory for branches: Path pointing to an existing root directory in SVN to create branches in. Example:
branches/&amp;amp&#59;amp&amp;&#35;59&#59;lt&amp;amp&#59;&amp;&#35;35&#59;59&amp;&#35;59&#59;projectName&amp;amp&#59;amp&amp;&#35;59&#59;gt&amp;amp&#59;&amp;&#35;35&#59;59&amp;&#35;59&#59;
Please note: This will register the Xyna Factory via the SVN Hook Manager (cf. fig. 1 (1.)) and enable XMOM Access and Code Access.
To enable SVN Access use the CLI command ./xynafactory.sh &amp;amp&#59;amp&amp;&#35;59&#59;&amp;amp&#59;&amp;&#35;35&#59;35&amp;&#35;59&#59;39&amp;amp&#59;&amp;&#35;35&#59;59&amp;&#35;59&#59;&amp;amp&#59;amp&amp;&#35;59&#59;&amp;amp&#59;&amp;&#35;35&#59;35&amp;&#35;59&#59;39&amp;amp&#59;&amp;&#35;35&#59;59&amp;&#35;59&#59;&amp;amp&#59;amp&amp;&#35;59&#59;&amp;amp&#59;&amp;&#35;35&#59;35&amp;&#35;59&#59;39&amp;amp&#59;&amp;&#35;35&#59;59&amp;&#35;59&#59;instantiaterepositoryaccessinstance&amp;amp&#59;amp&amp;&#35;59&#59;&amp;amp&#59;&amp;&#35;35&#59;35&amp;&#35;59&#59;39&amp;amp&#59;&amp;&#35;35&#59;59&amp;&#35;59&#59;&amp;amp&#59;amp&amp;&#35;59&#59;&amp;amp&#59;&amp;&#35;35&#59;35&amp;&#35;59&#59;39&amp;amp&#59;&amp;&#35;35&#59;59&amp;&#35;59&#59;&amp;amp&#59;amp&amp;&#35;59&#59;&amp;amp&#59;&amp;&#35;35&#59;35&amp;&#35;59&#59;39&amp;amp&#59;&amp;&#35;35&#59;59&amp;&#35;59&#59;
. To obtain the list of repository access specific parameters use ./xynafactory.sh &amp;amp&#59;amp&amp;&#35;59&#59;&amp;amp&#59;&amp;&#35;35&#59;35&amp;&#35;59&#59;39&amp;amp&#59;&amp;&#35;35&#59;59&amp;&#35;59&#59;&amp;amp&#59;amp&amp;&#35;59&#59;&amp;amp&#59;&amp;&#35;35&#59;35&amp;&#35;59&#59;39&amp;amp&#59;&amp;&#35;35&#59;59&amp;&#35;59&#59;&amp;amp&#59;amp&amp;&#35;59&#59;&amp;amp&#59;&amp;&#35;35&#59;35&amp;&#35;59&#59;39&amp;amp&#59;&amp;&#35;35&#59;59&amp;&#35;59&#59;listrepositoryaccessimpls&amp;amp&#59;amp&amp;&#35;59&#59;&amp;amp&#59;&amp;&#35;35&#59;35&amp;&#35;59&#59;39&amp;amp&#59;&amp;&#35;35&#59;59&amp;&#35;59&#59;&amp;amp&#59;amp&amp;&#35;59&#59;&amp;amp&#59;&amp;&#35;35&#59;35&amp;&#35;59&#59;39&amp;amp&#59;&amp;&#35;35&#59;59&amp;&#35;59&#59;&amp;amp&#59;amp&amp;&#35;59&#59;&amp;amp&#59;&amp;&#35;35&#59;35&amp;&#35;59&#59;39&amp;amp&#59;&amp;&#35;35&#59;59&amp;&#35;59&#59;
.
XMOM Access and Code Access can be enabled independently.
To checkin existing XMOM Objects in the newly created SVN repository use the CLI command ./xynafactory.sh refreshworkspace
.
When Path in SVN already points to a valid Xyna Project it will be checked out into the Workspace. If Path in SVN is empty, Xyna Factory will create a new project there and commit the following directories:
- common
- filter
- servicegroups
- sharedlib
- trigger
- XMOM
When creating a new Application from the Workspace with SVN Access enabled, a new branch will be automatically created in SVN. It is now possible to create a new Workspace from this branch (use branch/&amp;amp&#59;amp&amp;&#35;59&#59;lt&amp;amp&#59;&amp;&#35;35&#59;59&amp;&#35;59&#59;ApplicationName_Version&amp;amp&#59;amp&amp;&#35;59&#59;gt&amp;amp&#59;&amp;&#35;35&#59;59&amp;&#35;59&#59;
as Path in SVN parameter).
Exceptions during automatic build or deployment are stored in the corresponding Deployment State and can be reviewed in the Deployment Items section of the Xyna Factory Manager.