#
# Copyright (c) 2002-2004 Eric Wallengren
# This file is part of the Continuous Automated Build and Integration
# Environment (CABIE)
#
# CABIE is distributed under the terms of the GNU General Public
# License version 2 or any later version. See the file COPYING for copying
# permission or http://www.gnu.org.
#
# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED OR
# IMPLIED, without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. ANY USE IS AT YOUR OWN RISK.
#
# Permission to modify the code and to distribute modified code is granted,
# provided the above notices are retained, and a notice that the code was
# modified is included with the above copyright notice.
#
#
# Package declaration
#
package buildconf;
our ($VERSION);
$VERSION = "1.0";
#
# Use Carp for error handling
#
use Carp;
#
# Configuration section, edit to suite build machine configuration...
# To view configuration information from the server, use the
# dumpconfig command.
#
my %fields = (
BD => '/', #BuildDrive -
BSR => '/export/home/build/buildserver/server', # BuildServerRoot
BC => '/export/home/build/buildserver/server/bin/builder.pl', # BuildCommand
BTMP => '/tmp', # Where is temp?
CVSROOT => '/usr/cpsource/CVSROOT', # Place to locate CVS admin files
COMPANY => 'sct.com', # Company name (for email)
DFCMD => '/usr/bin/df -b', # df command, has no affect with win2k
DEFGROUP => 'dev', # Default group for cm systems
WORKDRIVE => '/', # Define workdir and drive
NULL => '/dev/null', # Define null device
JOBDIR => '/mnt/dev/builds', # Where do the jobs get copied to by the postbuild scripts
W2K => '/y', # Arg to W2k copy command
MAILER => '/export/home/build/buildserver/server/support/mailer.pl', # Mailer
SHAREPOINT => '\\\\buildserver\\build', # Network share point to be displayed in mailer...
SMTP => 'slcnot1.sct.com', # Where is the smtp server
SMTPDELIM => ',', # Delimeter for SMTP addressing
NOTIFYFROM => 'Build Server <ewalleng@sct.com>', # Build completion notification from
ADMIN => 'ewalleng@sct.com', # Address for build admin
ALTERNATE => 'setgw@earthlink.net', # Any alternate email addresses for catastrophic server events
WEBSERVER => 'http://slcdev24.sct.com/builds', # Web server where build can be found
RLCHG => 0, # Change number from SCCS (Don't edit)
BLDNUM => 0, # Incremental build number (if defined) (Don't edit)
INCREMENT => 0, # Boolean - always increment build number
LSTCHG => 0, # For perforce remote depots (Don't edit)
PARALLEL => 0, # Set to 0 if jobs should be run sequentially
PRN => 0, # A product release number (Don't edit)
REMOVEALL => 0, # Remove hashed number of saved builds (with .build file).f
PREBUILD => 'prebuild.sh', # name of prebuild trigger
POSTBUILD => 'postbuild.sh', # name of postbuild trigger
ONFAIL => 'onfail.sh', # name of failure trigger
RETAIL => 'rtlbuild.sh', # name of retail build script
DEBUG => 'dbgbuild.sh', # name of debug build script
UPDATEJOBS => 'updatejobs.sh', # name of script for updating build scripts
PROMOTION => '/mnt/dev/promotion', # name of parent directory for promoted builds
RELEASE => '/mnt/dev/GA', # name of parent directory for released builds
ISADDR => 'lmay@sct.com', # Name of someone in IS for HW problems
OPENFOLD => 'http://slcdev24.sct.com/icons/folder.open.gif', # Name and location of open folder icon used by genweb
CLOSEDFOLD => 'http://slcdev24.sct.com/icons/folder.gif', # Name and location of open folder icon used by genweb
GREENICON => 'http://slcdev24.sct.com/icons/greenlight.gif', # Name and location of green (success) icon
REDICON => 'http://slcdev24.sct.com/icons/redlight.gif', # Name and location of red (build failure) icon
YELLOWICON => 'http://slcdev24.sct.com/icons/yellowlight.gif', # Name and location of yellow (test failure) icon
RUNICON => 'http://slcdev24.sct.com/icons/runner.gif', # Name and location of job running icon
DISICON => 'http://slcdev24.sct.com/icons/smchk_rd.gif', # Name and location of job disabled icon
PROMOICON => 'http://slcdev24.sct.com/icons/disk.gif', # Icon used for build promotion
POLLFILE => 'poll.txt', # File to use for polling job in monitor thread
LOGOICON => 'http://slcdev24.sct.com/icons/sct_logo.gif', # Icon for company logo
CVS => 'http://slcdev24.sct.com/icons/cvs.gif', # Icon for CVS logo
PERFORCE => 'http://slcdev24.sct.com/icons/perforce.gif', # Icon for Perforce logo
CGIBIN => 'http://slcdev24.sct.com/cgi-bin', # Location for cgi-bin used by web server
USESQL => 1, # Is there a SQL backend? (1 true, 0 false)
SQLSERVER => 'slcdev2.sct.com', # Name:port of SQL server used for storing build information
SQLID => 'ewalleng', # Name of user with permissions to access SQL server
NOTIFYALL => 1, # Notify all upon build failures
GLOBMAIL => 'cpdevelopers@sct.com',
P4USER => 'build', # User ID for pulling and updating files from Perforce
P4PASSWD => 'wallyworld', # Password for perforce user
FAILALL => 0, # Notify for sequestial failures
NOTTESTED => 'BUILD NOT TESTED', # Name for file to be put in output directory
TESTED => 'BUILD PASSED SMOKETESTS', # Name for file when build has passed smoketests
);
#
# Change to suite job descriptions
#
sub formatjobid {
#
# Edit to suite the type of job number to construct from
# the builder process. Use $self->OPTION where OPTION is
# one of the following (from above):
# RLCHG real change no
# BLDNUM buildname.build file
# LSTCHG last change
# PRN product release number (static)
#
# Use any combination (or all of them) in the printf statement:
# sprintf "%s", $self->RLCHG
# sprintf "%s.%s", $self->BLDNUM, $self->RLCHG
#
my $self = shift;
my $IDFORMAT = sprintf "%s.%s", $self->RLCHG, $self->BLDNUM;
return $IDFORMAT;
}
#
# Do not edit anything below this line...
#
# Object constructor...
#
sub new {
my $that = shift;
my $class = ref($that) || $that;
my $self = {
%fields,
};
bless $self, $class;
return $self;
}
#
# Autoload definitions in this package...
#
sub AUTOLOAD {
my $self = shift;
my $type = ref($self) || croak "$self is not an object";
my $name = $AUTOLOAD;
$name =~ s/.*://;
unless (exists $self->{$name}) {
croak "Can't access `$name` field in an object of class $type";
}
if (@_) {
return $self->{$name} = shift;
} else {
return $self->{$name};
}
}
1;