AccuRev Triggers : Enabling a Trigger

Enabling a Trigger
Depending on its type, an AccuRev trigger is enabled in one of these ways:
•
Executing an accurev mktrig command, specifying the location of the script. AccuRev simply records the location you specify in the repository; it doesn’t make a copy of the script. Make sure that no one moves it!
•
For details, consult the appropriate subsection below:
pre-create-trig, pre-keep-trig, pre-promote-trig, server-post-promote-trig
Use the mktrig command to enable use of the script in a particular depot. For example:
accurev mktrig -p WidgetDepot pre-keep-trig /usr/ac_scripts/addheader
The –p option isn’t necessary if your current directory is in a workspace associated with that depot. When the trigger fires, AccuRev will search for the script at the specified pathname (in the example above, /usr/ac_scripts/addheader).
We strongly suggest specifying an absolute pathname. Otherwise, when the trigger fires, AccuRev will use the user’s search path (for pre-create-trig, pre-keep-trig, or pre-promote-trig) or the search path of the AccuRev Server’s user identity (for server-post-promote-trig) to find the specified script file.
server_admin_trig
Place an executable file in subdirectory triggers of the site_slice directory:
•
UNIX/Linux: the file must be named server_admin_trig or server_admin_trig.pl
•
Example:
C:\Program Files\AccuRev\storage\site_slice\triggers\server_admin_trig.bat
server_preop_trig
Place an executable file in subdirectory triggers of the slice directory of one or more depots (accurev show slices displays slice directory locations):
•
UNIX/Linux: the file must be named server_preop_trig or server_preop_trig.pl
•
Example:
/opt/accurev/storage/depots/talon_tests/triggers/server_preop_trig
server_dispatch_post
Place an executable file in the AccuRev executables (bin) directory on the AccuRev Server machine:
•
UNIX/Linux: the file must be named server_dispatch_post or server_dispatch_post.pl
•
Windows: the file must be named server_dispatch_post.bat
Note: for compatibility with previous AccuRev releases, the script can also be named dispatch_email, with the appropriate suffix.
Example:
C:\Program Files\AccuRev\bin\server_dispatch_post.bat
Notes on Triggers in Multiple-Platform Environments
If you have a mixed environment where you have both Windows and UNIX/Linux clients accessing the same depot, you can set up triggers that will operate for both.
•
Create trigger scripts that have the exact same name for both platforms, but ensure that the Windows version has the appropriate extension (e.g., check_for_comments.bat), and that the UNIX/Linux script has no extension (check_for_comments).
•
•
Place both versions of the script in the same directory. (You can place the Windows and UNIX/Linux scripts in separate directories if you need to, but we recommend keeping them together for simplicity and ease of maintenance.) This directory needs to be visible to all clients--it needs to be exported or shared from the server, and mapped or mounted on the clients.
•
Adjust the PATH on your clients to point to the proper directory for their platform. For example, the PATH setting “S:\triggers” on Windows clients might be be “/mnt1/ac/triggers” on UNIX/Linux machines.
•
Execute the mktrig command, specifying the script name without a suffix, and without a qualifying path:
accurev mktrig -p WidgetDepot pre-keep-trig check_for_comments
When called by a Windows client, the trigger script with an extension will get executed. When called by a UNIX/Linux client, the trigger script without the extension will get executed.
Remember to revise all versions of a script when you revise any one of them.

AccuRev, Inc.
Phone: 781-861-8700
Fax: 781-861-8704
support@accurev.com