So one of administration utilities developed by Seges is svnhooks set of hooks. This set contains utility svnreporter used to send reports after Subversion commit. Today supported way of sending is by email.
svnreporter is Java JAR utility which is managed through a simple configuration file. With this utility a sample post-commit script is provided. Installing it is simple as follows:
- copying post-commit script to Subversion hooks repository directory (for example /opt/your_repository/hooks)
- enabling execution of post-commit (like this - chmod 0755 post-commit)
- copying svnreporter Jar and libraries to a directory accessible by subversion
- setting variables in post-commit script - Java runtime executable, svnreporter Jar and configuration file location (Subvesion post-commit script doesn't inherit environment variables
- done :)
reporter.type=mail
svn.svnlook.file = /usr/bin/svnlook
mail.smtp.host = localhost
mail.smtp.user = svnreporter
mail.smtp.password = supersecret
mail.from = test@mydomain.com
mail.to = admin@mydomain.com, guest@mydomain.com
mail.bcc = boss@mydomain.com
svn.svnlook.file = /usr/bin/svnlook
mail.smtp.host = localhost
mail.smtp.user = svnreporter
mail.smtp.password = supersecret
mail.from = test@mydomain.com
mail.to = admin@mydomain.com, guest@mydomain.com
mail.bcc = boss@mydomain.com
And post-commit looks like this:
#!/bin/sh
REPOS="$1"
REV="$2"
SVNReporterDir="/opt/svnreporter"
#SVNReporterConf is specific to your repository
SVNReporterConf="$SVNReporterDir/svnreporter-repo1.conf"
SVNReporterJar="$SVNReporterDir/svnreporter.jar"
JAVA="/opt/java/jre/bin/java"
$JAVA -jar $SVNReporterJar -r "$REPOS" -R "$REV" -c $SVNReporterConf
REPOS="$1"
REV="$2"
SVNReporterDir="/opt/svnreporter"
#SVNReporterConf is specific to your repository
SVNReporterConf="$SVNReporterDir/svnreporter-repo1.conf"
SVNReporterJar="$SVNReporterDir/svnreporter.jar"
JAVA="/opt/java/jre/bin/java"
$JAVA -jar $SVNReporterJar -r "$REPOS" -R "$REV" -c $SVNReporterConf
If you want to see some log use -f
Well and that's your brand new mail report notification. More svnhooks utilities will come and if you have any ideas there is no broader space for solutions ;)