Giter Site home page Giter Site logo

oli99sc / yadt-config-rpm-maker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yadt/yadt-config-rpm-maker

1.0 1.0 0.0 874 KB

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.

License: GNU General Public License v3.0

Shell 2.45% Ruby 0.14% Python 97.41%

yadt-config-rpm-maker's Introduction

yadt-config-rpm-maker Build Status

  • Organize the configuration of your datacenter 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
  --debug               force DEBUG log level on console
  --no-syslog           switch logging of debug information to syslog off
  --version             show version
  --rpm-upload-cmd=RPM_UPLOAD_COMMAND
                        Overwrite rpm_upload_config in config file
  --config-viewer-only  Only generate files for config viewer. Skip RPM build
                        and upload.

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 our "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 Devlopment Enviroment

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

We recommend to develop in a vagrant box. Read our tutorial "How to develop in a vagrant box".

But of course you can set up a development environment on other platforms as well:

Run Tests

python setup.py test

The feedback of the test loader is not helping if the imports fail. This is a known bug issue7559. 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, the 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/magic.py

Execution in the working directory

./config-rpm-maker

The config-rpm-maker script allows you to execute 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 pull upstream master

... to omit merge problems.

Authors

License

yadt-config-rpm-maker Copyright (C) 2011-2013 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/.

yadt-config-rpm-maker's People

Contributors

aelgru avatar alosdev avatar girls-day avatar mriehl avatar oli99sc avatar schlomo avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.