Giter VIP home page Giter VIP logo

katello-packaging's Introduction

Katello Packaging

Requirements

If you're just submitting a fix, you don't need anything special.

If you're just submitting a patch which changes a source file, you will need:

However to release RPMs from this repo, you also require:

  • koji client and an account (certificate) on koji.katello.org
  • tito 0.5.6 or higher
  • scl-utils-build for scl packages
  • quvi package that is used by git-annex

HOWTO: checkout

Run:

  • git clone https://github.com/katello/katello-packaging
  • git annex init to set up this repo for using git annex
  • ./setup_sources.sh to register git-annex file URLs

HOWTO: test a package

Before tagging a build, please test it. Using tito's --test flag, you can generate test (S)RPMs by first committing your changes locally, then it will use the SHA in the RPM version.

With mock

Configuration for mock is supplied in mock/ and can be used to build any of the packages locally and quickly.

  1. Copy mock/site-defaults.cfg.basic to site-defaults.cfg, or look at other example configs for more options.
  2. tito build --rpm --test --builder builder.MockBuilder --arg mock_config_dir=mock/ --arg mock=el6-scl

The last argument is the name of the mock config in mock/, which includes SCL and non-SCL variants.

With koji access

If you have a certificate for our Koji server (regular packagers can get them), then you can use tito to build scratch packages on Koji, though it's slower than mock (above).

With sources in git(-annex):

tito release koji-katello --test --scratch

Alternative method with koji access

lzap's sbu utility is good for building test packages, especially with sources from elsewhere:

  1. sbu (defaults for EL6 with SCL)
  2. sbu katello fc19 katello-nightly-fedora19
  3. sbu katello el6 katello-nightly-nonscl-rhel6

Most packages should build for EL6 and EL7 with SCL.

To be able to build katello core packages with sbu, one needs to create script for each project name. It's purpose is to generate and copy source tarball to SOURCES/ directory. Typical script looks like:

$ cat .git/sbu-sources/katello-selinux
#!/bin/bash
DIR=$HOME/work/$(basename $0)
pushd $DIR
rake pkg:generate_source
popd
mv -v $DIR/pkg/*.tar.{bz2,gz} $HOME/rpmbuild/SOURCES/ 2>/dev/null

You'll also need an alias kojikat to point to:

koji -c ~/.koji/katello-config build

HOWTO: create a new core package or dependency

  1. Check if it's available in Fedora:
  1. If available in Fedora, copy the spec from the SCM link on the left
  2. Copy the template/ directory
  3. rename the spec file, don't use an SCL prefix
  4. update gem_name, version, ensure "Release" is 1
  5. empty the %changelog section
  6. express all gem dependencies as identical Requires in the spec file
  7. Download the source file (e.g. the .gem) into the spec directory and run git annex add foo.gem
  8. Update rel-eng/tito.props
  • If building for Fedora, add to the "katello-nightly-fedora19" whitelist
  • If building non-SCL only, add to the "katello-nightly-rhel+" blacklist
  • If building SCL EL6 only, no action required
  1. Update comps/comps-katello-*.xml
  2. Run ./comps_doc.sh to automatically add docs
  3. Commit the changes
  4. git add -A
  5. git commit -m "Add NAME package"
  6. Follow the "test a package" section above until it builds for all targeted platforms and required SCL + non-SCL modes.
  7. Submit a pull request against master branch.

HOWTO: update a package

  1. git rm foo-old.gem
  2. Change the version in the spec, set "Release" to 1
  3. Run gem compare -b foo 0.1 0.2 (needs gem-compare)
  4. update Requires to match changes in runtime dependencies
  5. add/remove entries in %files if required for new root files
  6. Download the source file (e.g. the .gem) into the spec directory and run git annex add foo.gem
  7. Commit the changes
  8. git add -A
  9. git commit -m "Update NAME to VERSION"
  10. Follow the "test a package" section above until it builds for all targeted platforms and required SCL + non-SCL modes.
  11. Submit a pull request against master branch.

How does this repo work?

This repo contains a directory per source package and some tito configuration and state (under rel-eng/). Each source package directory contains a spec file and patches under version control plus references to the source files (i.e. gems or tarballs).

These references are managed using git-annex, a git extension for tracking large binary blobs outside of the git repo itself. This means we can reference source files directly on rubygems.org etc, or perhaps set up a kind of lookaside cache in the future. For now, we use the special web remote with URLs to all of our source files available on the web.

tito's git-annex support will automatically (lazily) fetch files and cache them in your local git checkout as and when you build packages.

tito works in two key stages: tagging and releasing. For every RPM build, a tag needs to be created with tito (i.e. tito tag --keep-version) and this git tag is pushed to the central repository. tito helps by creating a %changelog entry and tags in standard formats etc.

When a tag is present in the central repository for a version, tito lets you build a SRPM and submit to koji, which builds the binary package (whereupon it gets pulled into our yum repositories). This tagging strategy means we can rebuild a package from any point in the repository's history, and since the git-annex metadata is part of the tagged commit, even the binary content is effectively under source control.

This repository is branched like Foreman itself, with rpm/1.x branches for major releases.

To find tito build targets do this:

$ tito release -l
[koji-katello]

License

Spec files are generally based on Fedora spec files, which means that unless a spec file contains an explicit license attribution within it, it is available under the MIT license.

katello-packaging's People

Contributors

adamruzicka avatar ares avatar bbuckingham avatar beav avatar bkearney avatar cfouant avatar chris1984 avatar daviddavis avatar ehelms avatar evgeni avatar jcpunk avatar jlsherrill avatar komidore64 avatar lzap avatar mbacovsky avatar mccun934 avatar narbutas avatar parthaa avatar pmoravec avatar sean797 avatar stbenjam avatar thomasmckay avatar xprazak2 avatar

Watchers

 avatar  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.