NAME

PkgForge::Handler - A Moose class to be used by PkgForge handlers.

VERSION

This documentation refers to PkgForge::Handler version 1.1.10

SYNOPSIS

package PkgForge::Handler::Foo;

use Moose;

extends 'PkgForge::Handler';

sub execute { }

DESCRIPTION

This is a Moose class which pulls together all the common aspects of Package Forge handlers. A handler is a class which does a specific job, for example: accepting incoming jobs or firing off builds of accepted jobs. This class requires that the sub-class implements a method named execute which actually does the work.

ATTRIBUTES

The following attributes will be part of any class which inherits from this class:

configfile

This is inherited from MooseX::ConfigFromFile (via PkgForge::ConfigFile), if specified it can be used to initialise the class via the new_with_config method. It can be a string or a list of strings, each file should be a YAML file, see PkgForge::ConfigFile for details.

debug

A boolean value to control whether or not debugging messages are logged. The default is false. Note that when using a logging configuration file it is better to control the minimum log level through that file.

incoming

The directory into which incoming package forge jobs will be submitted. The default is /var/lib/pkgforge/incoming

accepted

The directory into which package forge jobs will be transferred if they are accepted as valid. The default is /var/lib/pkgforge/accepted

results

The directory into which the results of finished package forge jobs will be stored. The default is /var/lib/pkgforge/results.

logdir

The directory into which log files will be stored by default. The default path is /var/log/pkgforge. This attribute does not currently have any direct effect on where the log files are stored. It is solely provided so that the server initialisation script can ensure that the correct directory exists.

logconf

The configuration file for the logging system. The default value is /etc/pkgforge/log-default.cfg. If this is not specified (i.e. set to undef) or does not exist then all messages will be logged directly to stderr. For servers that is almost certainly not what you want. See Log::Dispatch::Configurator::AppConfig for details of the configuration file format.

log_dispatch_conf

This is the configuration for Log::Dispatch, see that module for documentation. Also See MooseX::LogDispatch. You normally control this via the configuration file specified in the logconf attribute.

logger

This is a reference to the logger object, you can call methods such as debug and error on this object to log messages. See Log::Dispatch and Log::Dispatch::Config for full details.

SUBROUTINES/METHODS

A class which inherits from this class will have the following methods. This class also requires that the sub-class implements a method named execute which actually does the work.

new()

Create a new instance of the class. Optionally set some attributes by passing a hash as usual.

new_with_config()

Create a new instance of the class with attributes set by either entries in the configuration file or the usual hash. See MooseX::ConfigFromFile for details.

log_problem( $msg, $error_string )

The logger we are using has a tendency to eat the contents of the $EVAL_ERROR|$@ variable when it is called. This can make formatting error messages quite tricky. If you want your handler to print a message on one line and then add any message that might be in $EVAL_ERROR on a following line then use this method. Underneath it will use the error method of the logger.

CONFIGURATION AND ENVIRONMENT

By default Package Forge handlers can be configured via the YAML file /etc/pkgforge/handlers.yml This can be overridden by any handler class so also see the documentation for the specific class.

By default, the logging system can be configured via /etc/pkgforge/default.log. If the file does not exist then the handler will log to stderr.

DEPENDENCIES

This module is powered by Moose and uses MooseX::ConfigFromFile, MooseX::LogDispatch and MooseX::Types.

SEE ALSO

PkgForge

PLATFORMS

This is the list of platforms on which we have tested this software. We expect this software to work on any Unix-like platform which is supported by Perl.

ScientificLinux5, Fedora13

BUGS AND LIMITATIONS

Please report any bugs or problems (or praise!) to bugs@lcfg.org, feedback and patches are also always very welcome.

AUTHOR

Stephen Quinney <squinney@inf.ed.ac.uk>

LICENSE AND COPYRIGHT

Copyright (C) 201O University of Edinburgh. All rights reserved.

This library is free software; you can redistribute it and/or modify it under the terms of the GPL, version 2 or later.