mockchain use cases and examples

April 20, 2012

I’ve mentioned mockchain a few times here. An interaction with averi today on irc pointed out that I should give some examples of how to use it.

Use case #1:

I have a big pile of srpms – I’m pretty sure they all build, but not sure in what order, I want them all built against fedora-16-x86_64.

¬†mockchain fedora-16-x86_64 -l /tmp/myrepo –recurse *.src.rpm

That will produce a dir at /tmp/myrepo which has a config and results dir filled with: resulting pkgs and the logs from the build process in a subdir per package.

Inside the results dir there will be a fedora-16-x86_64 dir which is a yum repository and can be referred to in a yum repo configuration like:

[myrepo-fedora-16-x86_64]

name= my repo I just built with mockchain

baseurl=file:///tmp/myrepo/fedora-16-x86_64/

 

It will also try to build each and every package and any failures will be tried again after everything else has been built – and this will continue in a loop until either all the packages are successfully built or the failures are identical on two loops.

Use Case #2:

I have a bunch of src.rpms, I want to build them, one at a time. After each package build I want to rsync my packages up to fedorapeople immediately for everyone to use.

for pkg in ~/pkgs/*.src.rpm

do

mockchain fedora-16-x86_64 -l /tmp/myrepo $pkg

rsync -avH -e ssh /tmp/myrepo/results/ fedorapeople.org:public_html/myrepo

done

Use Case #3:

I have some new pkgs I want to build for fedora-16-x86_64. I have a remote repository that contains additional pkgs which provide some of my build dependencies for these new pkgs.

mockchain fedora-16-x86_64 -a http://servername/path/to/my/remote/repo -l  /tmp/myrepo -c *.src.rpm

 

This will give you a repo in /tmp/myrepo/results/fedora-16-x86_64

 

Just a few examples of how you can use mockchain in your daily operations.

About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: