wiki:Doc/SCDB/Server

Version 2 (modified by /C=FR/O=CNRS/OU=UMR8607/CN=Michel Jouvin/emailAddress=jouvin@…, 19 years ago) ( diff )

--

SCDB Server-side Customizations

TOC(inline)

This page describes the server-side SCDB specific tools and how to customize them. It doesn't explain how to install Quattor server and configure it for SCDB. Server-side tools consist in 2 scripts involved in configuration deployment and triggered by ant deploy.

Subversion Hook Script

This script must be installed on the Subversion server (not necessarily the Quattor server), inside the hooks directory of the SCDB repository. For this you need write access to the directory containing the repository on the Subversion server.

This script must be named post-commit and be executable. It is distributed as part of SCDB tools, inside src/hooks directory.

At the start of this script they are a couple of variables you must edit to reflect your site configuration. In particular :

  • QUATTORSRV : name of your Quattor server.
  • NOTIFY : email address to notify of deployment errors.
  • DEPLOYSCRIPT : path where is installed the deployment script (see below).
  • Command path for SVNLOOK and SSH

Deployment Script

This script is called by the hook script and does the real work by updating local copy of SCDB repository with passed tag and calling standard ant tasks.

It needs to be installed on the Quattor server and will be called through SSH by hook script (you need to configure a SSH key without password between your Subversion server and your Quattor server). The defaut location to install the script is `/root/quattor/scripts' but you can put it wherever you want as soon as you update the hook script accordingly. This script, build-tag.pl, is provided as part of SCDB tools inside src/hooks directory.

This script needs to find a file quattor.build.properties in the parent directory of SCDB local cache (generally parent directory for the script location).

In addition, it is possible to customize this script by adding a file /etc/build-tag.conf. This file must contain key/value pairs (with spaces or tabs between key and value, keys are not case sensitive). Supported configuration options are :

  • debug : display additional information if non zero.
  • java_home : path of Java virtual machine.
  • java_version : alternative to java_home. Must match a directory under /usr/java. Default : $JAVA_HOME if defined.
  • svn_cache : location to use for SCDB repository local cache. Default : svncache at same level as the directory where the script is installed.
  • use_svn : if non zero, force the use of svn command even if jsvn exists. Default : use jsvn from svn_cache if it is present. Note : using jsvn may affect performances.

Troubleshooting Server-side Scripts

If there is a problem with deployment after entering command ant deploy, people listed in NOTIFY variable of hook scripts should receive an email describing the problem. Note than ant deploy reports a success even if something wrong happens during deployment : ant success or failure only reflects Subversion commit (implied by ant deploy) status.

With some misconfiguration, it can happen you don't receive an email about the deployment failure. Or you may want to troubleshoot the problem. To achieve this, it is possible to execute manually the deployment script, build-tag.pl. For this you must proceed as follow (assuming your SCDB local cache is in /root/quattor/svncache and build-tag.pl is installed in /root/quattor/scripts) :

svn info /root/quattor/svncache
---> look at the current tag name, everything after /tags in the URL
svn update /root/quattor/svncache
---> Check it completes successfully
/root/quattor/scripts/build-tag.pl TAG-VALUE
Note: See TracWiki for help on using the wiki.