Delivery setup script

This setup script creates a preoperation trigger type, a postoperation trigger type, and an attribute type. The preoperation trigger action fires when a deliver operation starts, as represented by the deliver_start operation kind (opkind). The postoperation trigger action fires when a deliver operation is canceled or completed, as represented by the deliver_cancel and deliver_complete opkinds, respectively.

use Config;

my $PVOBTAG;
my $PREOPCMDW;
my $POSTOPCMDW;

$PREOPCMDW = '-execwin "ccperl
\\\\pluto\\c$\\ucmscripts\\ex1_preop.pl"';

$POSTOPCMDW = '-execwin "ccperl
\\\\pluto\\c$\\ucmscripts\\ex1_postop.pl"';
if ($Config{'osname'} eq 'MSWin32') {
   $PVOBTAG = '\cyclone-pvob';
}
else {
   $PVOBTAG = '/pvobs/cyclone-pvob';
}

my $PREOPCMDU = '';
my $POSTOPCMDU = '';
my $STREAM = "cc5testproj_Integration\@$PVOBTAG";
my $PREOPTRTYPE = "trtype:ex1_preop\@$PVOBTAG";
my $POSTOPTRTYPE = "trtype:ex1_postop\@$PVOBTAG";
my $CANXTRTYPE = "trtype:ex1_cancel\@$PVOBTAG";
my $ATTYPE = "attype:deliver_in_progress\@$PVOBTAG";print $PVOBTAG . "\n";
print $STREAM . "\n";
print $PREOPTRTYPE . "\n";
print $POSTOPTRTYPE . "\n";
print $CANXTRTYPE . "\n";
print $ATTYPE . "\n";
print ˋcleartool mktrtype -ucmobject -all -preop deliver_start 
$PREOPCMDU $PREOPCMDW -stream $STREAM -nc $PREOPTRTYPE;
print ˋcleartool mktrtype -ucmobject -all -postop deliver_complete
$POSTOPCMDU $POSTOPCMDW -stream $STREAM -nc $POSTOPTRTYPE;
print ˋcleartool mktrtype -ucmobject -all -postop deliver_cancel
$POSTOPCMDU $POSTOPCMDW -stream $STREAM -nc $CANXTRTYPE;
print ˋcleartool mkattype -vtype integer -default 1 -nc $ATTYPE;

The script runs on both Linux or the UNIX system and the Windows system. Because the command-line syntax to run the preoperation and postoperation scripts on Windows differs slightly depending on whether the PVOB resides on Windows or Linux, or the UNIX system, the setup script uses an IF ELSE Boolean expression to set the appropriate PVOB tag.

The mktrtype command uses the –ucmobject and –all options to specify that the trigger type applies to all UCM objects in the PVOB, but the –stream option restricts the scope to one integration stream.

The mkattype command creates an attribute type called deliver_in_progress, which the preoperation and postoperation scripts use to indicate whether a developer is delivering work to the integration stream.