p4 triggers/reviews

Getting email notfication from Perforce whenever there is a checkin to specified branch...

http://forums.perforce.com/index.php?/topic/528-getting-email-notfication-from-perforce-whenever-there-is-a-checkin-to-specified-branch/

 

Hi All,

I want to set up my perforce account to get email notification when somebody makes checking into to specified branch, how to do that please?

Could anybody please help me on this?

Thanks,
Sarma

 

Use a submit trigger:

http://www.perforce....f/triggers.html

 


You want the p4 review daemon:

http://public.perfor...m/wiki/P4Review

Regards,
--matt

 

I like to user Reviews.  In P4V do an Edit Current User and add a line to the Reviews section to path you want to monitor like:

//depot/<branch>...

This will give you an email on all Submits into this <branch>.  You can use wildcard to show only changes on configuration files like //<branch>.../pom.xml* and can even get to a specific file name like //<branch>.../mysource.java.

 

Use a submit trigger:

http://www.perforce....f/triggers.html

 

A review daemon might be better. It won't slow down your submits.

Stephen Vance

On Aug 3, 2010, at 9:42, Mark Evans <evansmark at gmail.com> wrote:

 

  First you need to set up a review daemon
(http://public.perfor...m/wiki/P4Review) to poll for changes to your
Perforce server. Once you've got that running, add a review to your user
for the location(s) you wish to get notification from.

For example you could set the following if you wish to get reviews when
someone changes something that deals with the build process
User:   mdelaney
Email:  mdelaney at therebepirates.com
Reviews:
         //depot/trunk/build/...
         //depot/trunk/.../Makefile


If you wish to do this via the graphical way, in p4v if you edit the
user your connected as (Connections -> Edit current user; then click the
review tab) then you'll be able to set reviews by selecting locations
from a tree view (much like the tree view when editing a client spec).

Hope that helps.

 

Reading time: about 2 minutes (450 words)

p4 triggers

Synopsis

Create or display a list of scripts to be run conditionally whenever changelists are submitted, forms are updated, or when integrating Perforce with external authentication or archive mechanisms.

Syntax


p4 [g-opts] triggers
p4 [g-opts] triggers -o
p4 [g-opts] triggers -i

Description

Perforce triggers are user-written scripts or programs that are called by a Perforce server whenever certain operations (such as changelist submission or changes to forms) are performed. If the script returns a value of 0, the operation continues; if the script returns any other value, the operation fails.

The p4 triggers command includes three variants:

  • With no options specified, the command invokes the default editor to allow the user to specify one or more trigger definitions.

  • The -i option specifies that the user use standard input to specify one or more trigger definitions.

  • The -o option displays the trigger definitions currently stored in the trigger table.

A trigger definition contains four fields that specify the name of the trigger, the type of event that should trigger the execution of the script, the location of the script, and other trigger type-dependent information. When the condition specified in a trigger definition is satisfied, the associated script or program is executed.

For detailed information about writing triggers and trigger definitions, see "Scripting Perforce: Triggers and Daemons" in the Perforce Server Administrator's Guide: Fundamentals.

Options

-i

Read the trigger table from standard input without invoking the editor.

-o

Write the trigger table to standard output without invoking the editor.

g-opts

See “Global Options”.

Usage Notes

Can File Arguments Use Revision Specifier?

Can File Arguments Use Revision Range?

Minimal Access Level Required

N/A

N/A

super

Examples

Suppose that the trigger table consists of the following entries:

Triggers:
    trig1 change-submit //depot/dir/...   "/usr/bin/s1.pl %changelist%"
    trig2 change-submit //depot/dir/file  "/usr/bin/s2.pl %user%"
    trig1 change-submit -//depot/dir/z*   "/usr/bin/s1.pl %user%"
    trig1 change-submit //depot/dir/zed   "/usr/bin/s3.pl %client%"

Note the indentation; the Triggers: field name is not indented; each row is indented with at least one space or tab character.

Both the first and third lines call the script /bin/s1.pl %changelist%, because the first occurrence of a particular trigger name determines which script is run when the trigger name is subsequently used.

No triggers are activated if someone submits file //depot/dir/zebra, because the third line excludes this file. If someone submits //depot/dir/zed, the trig1 script /usr/bin/s1.pl %changelist% is run: although the fourth line overrides the third, only the first script associated with the name trig1 is called.

For more detailed examples, see "Scripting Perforce: Triggers and Daemons" in the Perforce Server Administrator's Guide: Fundamentals.

Related Commands

To obtain information about the changelist being submitted

To aid daemon creation

posted @ 2015-04-28 14:59  alxe_yu  阅读(507)  评论(0)    收藏  举报