What's New in Tito 0.4.0: (mock builds, yum repo publishing)

I've just submitted Fedora updates for a new tito release 0.4.0, packages are also available for EL6, F15, and F16 in the devel repo. (tito is a build tool for RPM based projects using git, more information available here)

0.4.0 contains some significant changes and new functionality that could use some explanation.

Mock Builds

Firstly tito can now use Fedora's mock tool to build packages locally for other OS/versions/architectures, theoretically anything mock can handle on your system. This is contrary to the normal behaviour of "tito build" where we just want to quickly spin up an RPM for the system in question, thus it doesn't really make sense to configure as the default builder for your project.

Instead you can now override the builder at runtime, and pass generic builder arguments. This makes for a not-so-pretty command, but gets the job done and offers some nice functionality on the rare occasions when you do need it:


$ tito build --builder mock --builder-arg mock=fedora-15-x86_64 --rpm

Checking for tag [tito-0.4.0-1] in git repo [git@github.com:dgoodwin/tito.git]
Building package [tito-0.4.0-1]
Creating rpms for tito-0.4.0 in mock: fedora-15-x86_64
Wrote: /tmp/tito/tito-0.4.0.tar.gz
Wrote: /tmp/tito/tito-0.4.0-1.fc16.src.rpm
Using srpm: /tmp/tito/tito-0.4.0-1.fc16.src.rpm
Initializing mock...
Installing deps in mock...
Building RPMs in mock...

Wrote:
/tmp/tito/tito-0.4.0-1.fc15.noarch.rpm

This specifies a builder to use (in this case mock, which is a shortcut to tito.builder.MockBuilder, you can use the full Python module + classname as well), and a mock config file. Tito will initialize mock, install the dependencies for your package, build, and extract the resulting RPMs.

Release Module

"tito build --release" has been changed "tito release". Release targets are now configurable in releasers.conf, and tito can these individually or in a batch to publish your packages however you need, as opposed to the old behaviour which would try to publish to everything configured in tito.props. (the old config location) See man 5 releasers.conf for more information. (unless you're on EL5, which currently has no man pages. :))

Yum Releases

Leveraging the above, you can now build packages locally, potentially for several OS versions, sync down an existing yum repository, add the new packages, update the repodata, and push back up. This is based on the recommended procedure for Fedorapeople Repos, but hopefully it is generic enough to use even if you're hosting your own.

Tito's releasers.conf looks like the following:


$ cat rel-eng/releasers.conf
[yum-f15-x86_64]
releaser = tito.release.YumRepoReleaser
builder = tito.builder.MockBuilder
builder.mock = fedora-15-x86_64
rsync = fedorapeople.org:/srv/repos/dgoodwin/tito/fedora-15/x86_64/

[yum-f16-x86_64]
releaser = tito.release.YumRepoReleaser
builder = tito.builder.MockBuilder
builder.mock = fedora-16-x86_64
rsync = fedorapeople.org:/srv/repos/dgoodwin/tito/fedora-16/x86_64/

[yum-el6-x86_64]
releaser = tito.release.YumRepoReleaser
builder = tito.builder.MockBuilder
builder.mock = epel-6-x86_64
rsync = fedorapeople.org:/srv/repos/dgoodwin/tito/epel-6/x86_64/

To update all of these builds I would run:


RSYNC_USERNAME="dgoodwin" tito release --all-starting-with=yum

Sample output from a yum repo release target:


Releasing to target: yum-el6-x86_64
Wrote: /tmp/tito/subscription-manager-0.98.3.tar.gz
Wrote: /tmp/tito/subscription-manager-0.98.3-1.fc16.src.rpm
Creating rpms for subscription-manager-0.98.3 in mock: epel-6-x86_64
Using srpm: /tmp/tito/subscription-manager-0.98.3-1.fc16.src.rpm
Initializing mock...
Installing deps in mock...
Building RPMs in mock...

Wrote:
/tmp/tito/subscription-manager-debuginfo-0.98.3-1.el6.x86_64.rpm
/tmp/tito/subscription-manager-gnome-0.98.3-1.el6.x86_64.rpm
/tmp/tito/subscription-manager-0.98.3-1.el6.x86_64.rpm
/tmp/tito/subscription-manager-firstboot-0.98.3-1.el6.x86_64.rpm
/tmp/tito/subscription-manager-migration-0.98.3-1.el6.x86_64.rpm

Syncing yum repo: fedorapeople.org:/srv/repos/candlepin/subscription-manager/epel-6Server/x86_64/ -> /tmp/tito/tito-yumrepo-1U
mKIr
Copied /tmp/tito/subscription-manager-debuginfo-0.98.3-1.el6.x86_64.rpm to yum repo.
Copied /tmp/tito/subscription-manager-gnome-0.98.3-1.el6.x86_64.rpm to yum repo.
Copied /tmp/tito/subscription-manager-0.98.3-1.el6.x86_64.rpm to yum repo.
Copied /tmp/tito/subscription-manager-firstboot-0.98.3-1.el6.x86_64.rpm to yum repo.
Copied /tmp/tito/subscription-manager-migration-0.98.3-1.el6.x86_64.rpm to yum repo.
Refreshing yum repodata...
Syncing yum repository back to: fedorapeople.org:/srv/repos/candlepin/subscription-manager/epel-6Server/x86_64/

It's worth noting that this does not remove old versions of the package yet, but I hope to add this in a future release.

Other Things

Several bugs have been fixed including one where tito would refuse to build certain tags for no good reason, and re-tagging would just make the problem go away. Documentation has been updated (apologies but EL5 still has no man pages). Some of the Perl code used has been ported to Python as well.

What's Next?

Releasing into Fedora git, and a Koji scratch builder to build in Koji and then assemble the packages locally.

Props

Thanks to those who helped this release! (Alex Wood, Paul Morgan, Miroslav Suchý, Jesus Rodriguez, and Mike McCune)

As always if you encounter any issues please let us know in freenode's #tito, or via the github project page.

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
Type the characters you see in this picture. (verify using audio)
Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.