Skip to content

Latest commit

 

History

History
224 lines (195 loc) · 4.7 KB

build.adoc

File metadata and controls

224 lines (195 loc) · 4.7 KB

How to Build RPMs for the openshift-tools GitHub Repo

Description

This repository uses tito to make building and tracking revisions easy.

For more information on tito, please see the Tito home page

One Time Setup

To build the python-openshift-tools-* and openshift-tools-* rpms, we use Tito

Tito makes several assumptions that aren’t 100% compatible with the github workflow.

For instance:
  • Tito uses tags to keep track of revisions. You can’t create a PR for tags in github, so you have to push them directly to the upstream repo.

  • Tito calls the upstream repo origin, whereas we call our own fork of the upstream repo origin. This is very confusing because tito will output git commands to run against origin.

So, in order to keep everything straight, the recommended setup when using tito is to setup a git repo structure specifically for tito, and only use it for tito related activities.

Create the one time setup

Here are the steps to setup the recommended tito structure:
  1. Create a place to house the tito setup

    [user@desktop]$ mkdir -p ~/tito ~/.tito-build
  2. Go into the new place:

    [user@desktop]$ cd ~/tito
  3. Clone the openshift-tools repo:

    [user@desktop]$ git clone [email protected]:openshift/openshift-tools.git

Test the setup using just tito

  1. Change directory into the openshift_tools directory (this is where the spec file is):

    [user@desktop]$ cd ~/tito/openshift-tools/openshift_tools
  2. Do a test build using tito:

    [user@desktop]$ time tito build --test --rpm --output "$HOME/.tito-build"
  3. Output should look something like this:

    Building package [python-openshift-tools-0.0.6-1]
    Wrote: /tmp/tito/python-openshift-tools-git-0.88fc030.tar.gz
    
    [... snip ...]
    
    Successfully built: /tmp/tito/python-openshift-tools-0.0.6-1.git.0.88fc030.el6.src.rpm /tmp/tito/noarch/python-openshift-tools-0.0.6-1.git.0.88fc030.el6.noarch.rpm /tmp/tito/noarch/python-openshift-tools-monitoring-0.0.6-1.git.0.88fc030.el6.noarch.rpm /tmp/tito/noarch/python-openshift-tools-web-0.0.6-1.git.0.88fc030.el6.noarch.rpm
    
    real  0m3.311s
    user  0m1.159s
    sys 0m1.896s
    
    [user@desktop]$

Build python-openshift-tools-* RPMs

  1. Change into openshift-tools/openshift_tools directory

    cd ~/tito/openshift-tools/openshift_tools
  2. Get the latest code

    git pull
  3. Get the latest tags

    git fetch --tags
  4. Build test packages (no tagging needed)

    time tito build --test --rpm --output "$HOME/.tito-build"
  5. OPTIONAL: If a new version of the package is needed, follow these instructions:

    1. Tag a new build (bumps version number and adds log entries)

      tito tag
      # Something like this (copy it from the tito output):
      git push && git push origin package-name-and-new-VERSION
    2. Follow the on screen tito instructions to push the tags

  6. Build new packages based on the latest tag information

    time tito build --rpm --output "$HOME/.tito-build"

Build openshift-tools-scripts-* RPMs

  1. Change into openshift-tools/scripts directory

    cd ~/tito/openshift-tools/scripts
  2. Get the latest code

    git pull
  3. Get the latest tags

    git fetch --tags
  4. Build test packages (no tagging needed)

    time tito build --test --rpm --output "$HOME/.tito-build"
  5. OPTIONAL: If a new version of the package is needed, follow these instructions:

    1. Tag a new build (bumps version number and adds log entries)

      tito tag
    2. Follow the on screen tito instructions to push the tags

      # Something like this (copy it from the tito output):
      git push && git push origin package-name-and-new-VERSION
  6. Build new packages based on the latest tag information

    time tito build --rpm --output "$HOME/.tito-build"

Build openshift-tools-web-* RPMs

  1. Change into openshift-tools/web directory

    cd ~/tito/openshift-tools/web
  2. Get the latest code

    git pull
  3. Get the latest tags

    git fetch --tags
  4. Build test packages (no tagging needed)

    time tito build --test --rpm --output "$HOME/.tito-build"
  5. OPTIONAL: If a new version of the package is needed, follow these instructions:

    1. Tag a new build (bumps version number and adds log entries)

      tito tag
    2. Follow the on screen tito instructions to push the tags

      # Something like this (copy it from the tito output):
      git push && git push origin package-name-and-new-VERSION
  6. Build new packages based on the latest tag information

    time tito build --rpm --output "$HOME/.tito-build"