Skip to content
This program is called as a commit hook in a config SVN repository and automatically creates the necessary config RPMs after every commit and puts them in the configured RPM repository.
Python Shell Ruby
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
develop-in-a-vagrant-box
docs
src/config_rpm_maker
test
testdata
.committerrc
.gitignore
.travis.yml
LICENSE.txt
MANIFEST.in
README.md
config-rpm-maker
create-test-data-hosts.py
rpm.build
setup.cfg
setup.py
setup_debian.sh
yadt-config-rpm-maker.yaml

README.md

yadt-config-rpm-maker Build Status

  • Organize the configuration of your data center hosts in a subversion repository.
  • Run config-rpm-maker as post-commit hook of your configuration repository:
    • Builds RPMs containing the configuration for each host.
    • Builds only the configuration RPMs for the affected hosts.
    • Uploads configuration RPMs to a repository using a configurable command.
Usage: config_rpm_maker repo-url revision [options]

Arguments:
  repo-url    URL to subversion repository or absolute path on localhost
  revision    subversion revision for which the configuration rpms are going
              to be built

Options:
  -h, --help            show this help message and exit
  --config-viewer-only  Only generate files for config viewer. Skip RPM build
                        and upload.
  --debug               force DEBUG log level on console
  --no-clean-up         do not clean up working directory
  --no-syslog           switch logging of debug information to syslog off
  --rpm-upload-cmd=RPM_UPLOAD_COMMAND
                        Overwrite rpm_upload_config in config file
  --verbose             increase number of logging messages
  --version             show version

Examples

config-rpm-maker /path-to/your/svn/repository/ 123

Builds all relevant configuration RPMs from the repository at file:///path-to/your/svn/repository/ in revision 123.

config-rpm-maker file://host/path-to/your/svn/repository/ 123
config-rpm-maker svn://host/repository/ 123

Features

  • Creates data for configviewer (visualises the configuration of your hosts)
  • Templating for your configuration files.
  • Preserves encoding and will not replace tokens within binary files see TokenReplace.filter_file

Getting Started

If you simply want to try and understand how yadt-config-rpm-maker works we recommend to "setup a devlopment enviroment".

Step by Step Installation

Step 1

Install the build dependencies

sudo yum install python-devel python-setuptools python-mock mock -y

Install dependencies

sudo yum install subversion rpm-build pysvn python-yaml -y
Step 2

Build the source rpm

./setup.py bdist_rpm --source-only

Build the rpm from the source rpm using mock.

sudo mock rebuild yadt-config-rpm-maker-2.0-1.src.rpm -v
Step 3

Set up a subversion repository. There are several tutorials available in the web. Some examples:

and run config-rpm-maker in a post-commit hook.

Configuration

yadt-config-rpm-maker is configured using a yaml file. Read more in "Configuration Documentation".

Example Content for Configuration Repository

The testdata directory contains an example tree for a config repository. It also contains the SPEC file template that is used to build the config RPMs. Use this as a starting point to setup your own environment.

Build

Setup a Development Environment

yadt-config-rpm-maker is created for Red Hat Linux Distributions.

We recommend to develop in a vagrant box. Read our tutorial "Build and install in a vagrant box".

Of course you can set up a development environment on other platforms too:

Run Tests

python setup.py test

The feedback of the test loader is not helping if the imports fail. This is a known issue (see 7559). But there are import checks in test/__init__.py

Run the checks to see if you have import errors by executing:

PYTHONPATH=src python test/__init__.py

When you run the integration tests yadt-config-rpm-maker will build test RPMs.

Measuring test coverage using coverage

coverage run --branch setup.py test && coverage report --omit=test/*,/usr/*,setup.py,src/config_rpm_maker/utilities/magic.py

Execution in the working directory

./config-rpm-maker

The config-rpm-maker script allows you to execute yadt-config-rpm-maker in your working directory.

Build yadt-config-rpm-maker RPM

python setup.py bdist_rpm

Contribute

Please don't forget to add our repository as remote to your fork

git remote add upstream https://github.com/yadt/yadt-config-rpm-maker.git

... and pull from time to time via ...

git remote update
git merge upstream/master --ff-only

... to omit merge problems.

Authors

License

yadt-config-rpm-maker Copyright (C) 2011-2014 Immobilien Scout GmbH

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Something went wrong with that request. Please try again.