This project is to show examples of triggers for Perforce.
This is an example of a change-content trigger - with the following features:
Install an entry in triggers table similar to:
ValidateContent submit-content //depot/... "P4NetContentTrigger.exe -p %serverport% -u p4admin -c %changelist%"
The above assumes a user called "p4admin" with appropriate privileges to read the requiredand changelists, and with a login ticket accessible via the environment (so set P4TICKETS in the environment of your service and ensure this user is logged in and part of a Perforce group with Timeout: field set to "unlimited").
Parameters to P4NetContentTrigger.exe:
-p, --port (uses environment if not defined) P4PORT to connect to
-u, --user (uses environment if not defined) P4USER to connect as
-c, --change Required. Changelist to process/validate.
-t, --testing (Default: False) Testing mode - if first line of a file contains 'fail' will return error otherwise success.
-v, --verbose (Default: False) Makes sure log4net logging is set to Debug level. Otherwise edit log4net.properties file.
-h, --help
Perforce Example Triggers === This project is to show examples of triggers for Perforce. P4NetContentTrigger === This is an example of a change-content trigger - with the following features: * written in C# (Visual Studio 2010 but should be forwards compatible) * uses P4API.NET * shows how to turn on logging of all API calls (useful for debugging) * has a Python test harness (showing live trigger installation - based on other work) Usage -- Install an entry in triggers table similar to: ValidateContent submit-content //depot/... "P4NetContentTrigger.exe -p %serverport% -u p4admin -c %changelist%" The above assumes a user called "p4admin" with appropriate privileges to read the requiredand changelists, and with a login ticket accessible via the environment (so set P4TICKETS in the environment of your service and ensure this user is logged in and part of a Perforce group with Timeout: field set to "unlimited"). Parameters to P4NetContentTrigger.exe: -p, --port (uses environment if not defined) P4PORT to connect to -u, --user (uses environment if not defined) P4USER to connect as -c, --change Required. Changelist to process/validate. -t, --testing (Default: False) Testing mode - if first line of a file contains 'fail' will return error otherwise success. -v, --verbose (Default: False) Makes sure log4net logging is set to Debug level. Otherwise edit log4net.properties file. -h, --help Packages Referenced -- * CommandLineParser * log4net
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 21996 | sbrown | "Forking branch Main of robert_cowham-p4triggers to sbrown-p4triggers." | ||
//guest/robert_cowham/p4triggers/main/README.md | |||||
#5 | 19988 | Robert Cowham |
Rename P4.Net API to P4API.NET. Extra info for README |
||
#4 | 19980 | Robert Cowham | Tweak formatting | ||
#3 | 19979 | Robert Cowham | Tweak formatting | ||
#2 | 19978 | Robert Cowham | Minor refactoring - make changelist parameter required | ||
#1 | 19975 | Robert Cowham | Check in packages used. |