These sample hook scripts should give you an idea how custom event handlers can be
written. Feel free to adjust them to your own needs.
Note: These sample event handlers are not officially supported by CollabNet and
must be used at your own risk.
-
Hooks must be owned by sf-admin for security, and must have the executable bit
set.
-
To configure a site to prevent projects being deleted, we could create this
file:
/opt/collabnet/teamforge/hooks/synchronous/project_delete
#!/bin/sh
echo Sorry, projects cannot be deleted on this site 1>&2
exit 1
-
To automatically create an initial directory structure in an SVN repository
when the repository is created, you might create this file:
/opt/collabnet/teamforge/hooks/asynchronous/repository_create
#!/bin/sh
/usr/bin/svn
mkdirhttp://localhost/svn/repos/${tf_original_RepositoryDirectory:9:999}/trunk
http://localhost/svn/repos/${tf_original_RepositoryDirectory:9:999}/tags
http://localhost/svn/repos/${tf_original_RepositoryDirectory:9:999}/branches
-m "Inital Structure"
--username admin --password mypassword --non-interactive --no-auth-cache
exit 0