Trigger definition
After you have written a trigger, you create the trigger definition by
issuing the
command and providing trigger
information in the triggers form. You must be a
Helix Server
superuser to run this command. The p4 triggers
p4 triggers
form
looks like this:
Triggers: relnotecheck change-submit //depot/bld/... "/usr/bin/rcheck.pl %user%" verify_jobs change-submit //depot/... "/usr/bin/job.py %change%"
Field names (such as Triggers:
)
must be flush left (not indented) and must end with a colon. Field
values (that is, the set of lines you add, one for each trigger) must be
indented with spaces or tabs on the lines beneath the field name.
Each line in the trigger form you fill out when you use the p4
triggers
command has the following four fields:
Field | Meaning | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
The user-defined name of the trigger. To use the same trigger script with multiple file patterns, list
the same trigger multiple times on contiguous lines in the
trigger table. Use exclusionary mappings to prevent files from
activating the trigger script. The order of the trigger entries
matters, just as it does when exclusionary mappings are used in
views. In this case, only the |
||||||||||||||||
|
Each type of trigger corresponds to an event that causes that type of trigger to fire.
|
||||||||||||||||
|
The meaning of this field depends on the trigger type. For example:
To learn what this field means for a trigger type that you want to use, see the section about that trigger type. |
||||||||||||||||
|
The trigger for Helix Server to run when the conditions of the trigger definition are satisfied. You must specify the name of the trigger script or executable in ASCII, even when the server is running in Unicode mode and passes arguments to the trigger script in UTF8. Specify the trigger in a way that allows Helix Server
to locate and run the command. The On those platforms where the operating system does not know how
to run the trigger, specify an interpreter in
the command field. For example, Windows does not know how to run
lo form-out label "perl //myscripts/validate.pl" When your trigger script is stored in the depot, its path must
be specified in depot syntax, delimited by percent characters.
For example, if your script is stored in the depot as
|
Triggers are run in the order listed in the trigger table. If a trigger script fails for a specified type, subsequent trigger scripts also associated with that type do not run.
The p4 triggers
command has this
syntax:
p4 triggers [ -i | -o ]
- With no flags, the user’s editor is invoked to specify the trigger definitions.
- The
-i
flag reads the trigger table from standard input. - The
-o
flag displays all the trigger definitions stored in the trigger table.