Standalone client deploy and setup

Garfio standalone client is distributed as a JAR. It is a standalone application that can be launched from Subversion (SVN) repositories hooks (pre-commit and post-commit). It is also ready for communicating with Garfio Server through SOAP messages. Garfio server accomplishes two goals Garfio standalone client is distributed as a JAR. It is a standalone application that can be launched from Subversion (SVN) repositories hooks (pre-commit and post-commit). It is also ready for communicating directly with the issue tracker.

Hooks

Garfio is based on the possibility of executing pre-commit and post-commit hooks in SVN repositories. In the pre-commit phase, Garfio only parses the message for validation but no action is executed on the issue tracker. In case of error, Garfio will prevent the commit from being executed and will inform the error to the user.

Actions over the issue tracker will be executed in the post-commit phase, after parsing the message again for retrieving all the information.

Let's see two possible hooks for a SVN repository and standalone client:

pre-commit

File: pre-commit

This file should be installed in the hooks directory inside the repository. It will call Garfio script with all the necessary parameters.


#   [1] REPOS-PATH   (the path to this repository)
#   [2] TXN-NAME     (the name of the txn about to be committed)
REPOS="$1"
TXN="$2"

#Directory where the Garfio scripts live
path=/home/user/garfio/scripts

#Repository name created in the Garfio web application
repo=uat

# Make sure that the log message contains some text.
SVNLOOK=/usr/bin/svnlook
$SVNLOOK log -t "$TXN" "$REPOS" |  grep "[a-zA-Z0-9]" > /dev/null || exit 1
$path/do-pre.sh "$REPOS" "$TXN" repo dry-run


File: do-pre.sh

This script will execute Garfio Standalone Client in dry-run mode, just to validate the message (no action is taking place in the issue tracker).


REPOS="$1"
REV="$2"
name="$3"

author="`svnlook author -t $REV $REPOS`"

#Path where the Garfio Jar lives
path=/home/user/garfio

#Garfio Jar
garfio=$path/garfio-0.5-SNAPSHOT-jar-with-dependencies.jar

svnlook log -t $REV $REPOS | java -jar $garfio $REV "$author" $path/conf/$name dry-run 


post-commit

File: post-commit

This file should be installed in the hooks directory inside the repository. It will call Garfio post commit script.


#   [1] REPOS-PATH   (the path to this repository)
#   [2] REV          (the number of the revision just committed)
REPOS="$1"
REV="$2"

#Directory where the Garfio scripts live
path=/home/user/garfio/scripts

#Repository name created in the Garfio web application
repo=uat

$path/do.sh "$REPOS" "$REV" $repo


File:do.sh

This script will execute Garfio Standalone Client to perform all the required actions on the issue tracker.


REPOS="$1"
REV="$2"
name="$3"
author="`svnlook author -r $REV $REPOS`"

#Directory where the Garfio scripts live
path=/home/user/garfio/scripts

garfio=$path/garfio-0.4-jar-with-dependencies.jar
cd $path/cwd
LC_ALL=es_AR svnlook log -r $REV $REPOS | 
LC_ALL=es_AR java -jar $garfio $REV "$author" $path/conf/$name > /dev/null 2>&1 &