#
# Example configuration file showing many constructs.
# Taken from the Test::AutoBuild distribution
#
# Test-AutoBuild main configuration file.
#
# Short documentation can be found inline, and for further
# information consult the manual page 'man 5 auto-build.conf'
#

# Path to the build engine definition. This determines the
# sequence of stages executed by the build engine, package
# types to publish, and other miscellaneous aspects of the
# build engine's runtime environment. 
# It will typically suffice to leave this on the default
# setting
engine = /etc/auto-build.d/engine/host-build.conf
# If you want to use SELinux MAC, then uncomment this
# and run with '/usr/bin/auto-build-secure' instead
#engine = /etc/auto-build.d/engine/host-build-secure.conf

# The location of the directory containing the template files
# for the HTML status pages, and email alert messages
templateDir = /etc/auto-build.d/templates

# The directory under which the build engine will run. This
# should match whatever path was provided when running the 
# 'auto-build-make-root' script. /var/lib/builder is the default
# directory created by the RPM perl-Test-AutoBuild-account
buildRoot = /var/lib/builder

# A name for the build instance. This is used in the HTML
# status pages, email alert subject, and RSS feeds
label = Continous Automatic Builder

# Name and email address of the build administrator
adminEmail = admin@example.com
adminName = Build Administrator

# Name and email address of the development team writing the
# software being built. Typically point it to the main developer
# mailing list
groupEmail = dev@example.com
groupName = Build Developers

# If the build host has multiple names, then specify which
# one is used for the virtual host publishing the HTML status
# pages. This will be used to construct links in the RSS feed
# and email alert messages. If not set, defaults to the primary
# hostname of the machine
#hostname = example.com

# The prefix under which the HTML status pages are located.
# If using /etc/auto-build.d/httpd/aliased.conf, then
#httpPrefix  = /builder
# Else with /etc/auto-build.d/httpd/user.conf, then
#httpPrefix  = /~builder
# Finally with /etc/auto-build.d/httpd/vhost.conf, then
httpPrefix  =

# Where to save a log of the build engine progress (this
# data is also sent to STDERR, but when run from cron this
# typically ends up in /dev/null)
engineLogFile = /var/lib/builder/autobuild.log

# The method used for acquiring a lock file to prevent multiple
# build instances running at the same time against the same
# buildRoot directory. 
#  * fcntl - Best option, but only implemented for Linux, SunOS
#            and FreeBSD
#  * flock - Portable to any UNIX, but does not completely protect
#            if buildRoot is on an NFS volume
#  * file  - Simple file creation/deletion test. If the build engine
#            or host machine crashes, it will be neccessary to manually
#            delete the lock file ($buildRoot/.build.mutex)
lockMethod = fcntl

# Define what high level features you want enabled
features = {
  # If the cache is enabled, then modules will only be built if their
  # sources have changed since the previous build cycle. This provides 
  # much faster cycle times if there are many modules in the build
  # config, only a few of which ever change
  cache = 1

  # Whether to try and checkout the latest sources from version control
  # If checkout is disabled, the build will run with whatever sources
  # were checked out on the previous cycle.
  checkout = 1

  # Whether to run the 'createrepo' tool against the RPMs on the HTTP
  # distribution site
  createrepo_index = 1

  # Whether to run the 'yum-arch' tool against the RPMs on the HTTP
  # distribution site
  yum_index = 0

  # Whether to generate an APT index of RPMs / Debian packages on the
  # HTTP distribution site
  apt_index = 0

  # Whether to send email alerts at the end of cycles
  email_alerts = 1
}

# Describe 'interesting' metadata about the build platform
platform = {
  # Taken from /etc/issue, if not set
  #label = RHEL-4, Update 2

  # Taken from uname(2) 'sysname' if not set
  #operating_system = GNU/Linux

  # Taken from uname(2) 'machine' if not set
  # architecture = i386

  # Arbitrary administrator specific options...
  #options = {
  #  compiler.cc = GCC 4.0.2
  #  linker = GNU ld 2.15.94.0.2.2
  #}
}

# Criteria for sending email alerts
alert = {
  # If the scope is set to
  #  * builder - one email is sent with info on all modules
  #  * module  - one email is sent for each module
  scope = builder

  # Conditions for sending alerts
  #  * always     - send regardless of status
  #  * fail       - send whenever the status is 'failed'
  #  * first-fail - send on the first failure only
  trigger = first-fail

  # If scope is set to 'builder' then
  #
  #  * admin - use the global address defined for $adminEmail
  #  * group - use the global address defined for $groupEmail 
  #
  # If scope is set to 'module' then
  #
  #  * admin - use the module specific address defined for $adminEmail
  #  * group - use the module specific address defined for $groupEmail
  #
  # Or just set an explicit email address (separate multiple address with ,)
  to = group

  # What to set the 'From' address to
  #from = builder@example.com

  # The SMTP server to relay the mail via, defaults to localhost
  #smtpServer = mail.example.com
}

# Set the maximum disk space allowed for use by the cache
maxCacheSize = 100M

# Set the maximum number of days to keep a cache around before
# considering it expired
maxCacheAge = 7d


# Module groups (for web status)
groups = {
  software = {
      label = Software
  }
  autobuild = {
      label = Test-AutoBuild
  }
#  docs = {
#      label = Documentation
#  }
}

# Global environment variables which will be set whenever
# any command is run by the build engine
env = {
  USER = builder
}

# Define the source control repositories from which modules
# will be checked out. There are 7 supported repository types
# at this time. Depending on the 'type' parameter, various
# 'env' or 'option' parameters may be required
#
#  cvs  - CVS. Specify the CVSROOT environment variable, and 
#         optionally a CVS_RSH variable
#
#           env = {
#             CVSROOT = :pserver:anonymous@cvs.gna.org:/cvs/testautobuild
#           }
#
#  p4   - Perforce. Specify the P4CONFIG environment variable 
#         for a client view. The viewspec will be filled in 
#         automatically
#
#           env = {
#             P4CONFIG = /var/lib/builder/.p4config
#           }
#
#  tla  - GNU Arch. Specify the 'archive-name' and 'archive-uri'
#         options for the remote repository. eg, 
#
#           options = {
#             archive-name = lord@emf.net--2004
#             archive-uri = http://arch.quackerhead.com/~lord/archives/lord@emf.net--2004
#           }
#
#  hg   - Mercurial. Specify the 'base-url' option to refer to
#         the base URL under which the repositories are located
#
#           options = {
#             base-url = http://www.selenic.com/
#           }
#
#  git  - Git. Specify the 'base-url' option to refer to
#         the base URL under which the repositories are located
#
#           options = {
#             base-url = git://anongit.freedesktop.org/git/
#           }
#
#  darcs - Darcs. Specify the 'base-url' option to refer to
#          the base URL under which the repositories are located
#
#           options = {
#             base-url = http://www.darcs.net/repos/
#           }
#
#  bzr   - Bazaar. Specify the 'base-url' option to refer to
#          the base URL under which the repositories are located
#
#           options = {
#             base-url = http://www.darcs.net/repos/
#           }
#
#  svn  - Subversion. Specify the 'url' option to refer to the base
#         URL for the repository
#
#           options = {
#             url = http://aplaws.redhat.com/svn/aplaws/
#           }
#
#  svk  - SVK. No special options. The modules contain the full URL
#
#  disk - Local disk. Specify the 'directory' otion to refer to the 
#         base directory containing the files
#
#           options = {
#             directory = /var/lib/builder/local-files
#           }
#
repositories = {
  gna-cvs = {
    label = GNA Anonymous CVS Server
    type = cvs
    env = {
      CVSROOT = :pserver:anonymous@cvs.gna.org:/cvs/testautobuild
    }
  }
}

# Now, the list of modules to checkout from the repositories
# defined above.
modules = {
  autobuild-dev = {
    # This is used in email alerts, HTML status pages & RSS feeds
    # to refer to the module
    label = Test AutoBuild Unstable

    # If different from global settings. These will be used if
    # the email alert scope is set to 'module'
    #
    #admin-email = autobuild-admin@example.com
    #admin-name = Module Administrator
    #group-email = autobuild-dev@example.com
    #group-name = Module Developers

    # The source code to check out
    source = {
      # Name of the repository defined above
      repository = gna-cvs

      # The path within the repository to be checked out
      path = testautobuild
    }

    # Any module specific environment variables to be set when
    # executing the module control file
    env = {
      HTMLURLPREFIX = /~builder/artifacts/autobuild-dev/apidocs
    }
    # List of groups (defined earlier) which this module is a
    # member of
    groups = (
      autobuild
      software
    )
    # Arbitrary list of hyperlinks to associate with this module
    # in the HTML status pages. Typically link to the module
    # developer web pages & source code browser
    links = (
      {
        href = http://www.autobuild.org/
        label = Homepage
      }
      {
        href = http://cvs.gna.org/viewcvs/testautobuild/testautobuild/
        label = Browse CVS Repository
      }
    )
    # List of artifacts generated during build which should be 
    # published on the HTML pages. For example, code cover reports
    # API documentation. The 'src' parameter is relative to the
    # module's root source code directory. The 'dst' parameter is
    # the URL prefix under which to save the artifact. The optional
    # 'path' parameter is needed if there is no index file in the
    # directory copied.
    artifacts = (
      {
        src = README
        dst = README
        label = Readme
      }
      {
        src = blib/coverage/*
        dst = coverage/
        label = Code Test & POD coverage Reports
      }
      {
        src = blib/html/*
        dst = apidocs/
        path = apidocs/Test/AutoBuild.html
        label = Module API documentation
      }
    )
  }
}

# Optionally, the packages (RPMs, etc) generated during the
# build can be built into an ISO image for distribution
isos = {
  autobuild-unstable = {
    # File name for the ISO image
    name = autobuild-unstable.iso
    # Label to use in link for HTML status pages
    label = Test-AutoBuild Unstable
    # The package types to include in the ISO, can be
    # one or more of 'rpm', 'zip', 'debian'
    packageTypes = (
      rpm
      zip
    )
    # List of modules whose packages should be included
    # in the ISO
    modules = (
      autobuild-dev
    )
  }
}

# That's all folks!
