NAME
PkgForge::Builder - A Moose role to be used by PkgForge builders.
VERSION
This documentation refers to PkgForge::Builder version 1.1.10
SYNOPSIS
package PkgForge::Builder::Foo;
use Moose;
with 'PkgForge::Builder';
sub verify_environment { ... }
sub run { ... }
sub submit_packages { ... }
DESCRIPTION
This is a role which gathers common functionality and sets some requirements on how a Package Forge builder class must be implemented.
ATTRIBUTES
The following attributes will be part of any class which implements this role:
- resultsdir
-
This is the location of the directory into which results will be stored. This is the top-level directory, within this directory there will be a sub-directory for each job and within that a sub-directory for each task. This attribute must be specified.
- logdir
-
This is the location of the directory into which the log file for the builds will be stored. This attribute must be specified. After completion of the build the log file will be copied to the specific results directory.
- platform
-
This is the name of the platform for which the builder is being used, for example,
f13
orsl5
. This is a required attribute. - architecture
-
This is the name of the architecture for which the builder is being used, for example,
i386
orx86_64
. This does have any significance on some platforms so it is an optional attribute. - name
-
This is the name of the builder process. Normally you do not need to set this attribute, the default is the combination of the platform and architecture (if set) joined with a hyphen, e.g. platform
f13
and architecturex86_64
gives a name off13-x86_64
. - timeout
-
This is the maximum time (in seconds) that the build process is allowed to take. Any process still running after this time should be killed.
- error_policy
-
This is a string used to record the required response to any source package build errors. The currently supported values are
retry
andimmediate
. In immediate-mode the builder will stop as soon as any source package in the job fails to build. The default is retry-mode in which the builder will keep attempting to build more packages for the job as long as more build each time. This is very useful as it is often the situation that a job contains a set of packages where some of them have build-dependencies on others. Ordering them manually might be difficult so in the retry-mode although the job might take a bit longer to build there is an improved chance of complete success.
SUBROUTINES/METHODS
The following methods are available to all classes which implement this role:
- build( $job, $resultsdir )
-
This method takes a PkgForge::Job object and the base results directory into which build results and log files are stored. These are passed into the
new_topic
method and then the newly created BuildTopic is passed to therun
method (which must be implemented by each class). If the run method returns successfully then thesubmit_packages
method (which must also be implemented by each class) is also called with the BuildTopic object. - new_topic( $job, $resultsdir )
-
This method takes a PkgForge::Job object and the base results directory into which build results and log files are stored. Within this directory a job/build specific directory tree will be assembled along the lines of
uuid/platform-arch/
(e.g.i8Mq2Q0nRaG171vp1FpLxw/f13-i386/
). This method returns a PkgForge::BuildTopic object which is a simple container for various information related to building a particular job on a particular platform and architecture. Most builder methods which do work expect to receive a BuildTopic object. - filter_sources($job)
-
This method takes the PkgForge::Job object and filters the source packages to find those which are suitable for this builder. For example, if the builder only accepts SRPMs then a list of only those packages which are in the PkgForge::Source::SRPM class will be returned.
This role requires that any implementing class provides the following methods:
- verify_environment()
-
This method should validate the build environment and return 1 if everything is correct. If a problem is found the method should die with a useful message.
- run($topic)
-
This is the main method which does the work of building the packages from source. It receives the PkgForge::BuildTopic object.
- submit_packages($topic)
-
This method is used for submitting the built packages to the specified results directory. You need to pass in an PkgForge::BuildTopic object.
CONFIGURATION AND ENVIRONMENT
This module does not use any configuration files. You will need to install the correct build tools for the target platform (see the information in the documentation for the specific module you require).
DEPENDENCIES
This module is powered by Moose and uses MooseX::Types.
SEE ALSO
PkgForge, PkgForge::Builder::RPM, PkgForge::BuildTopic
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) 2010-2011 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.