These scripts reduce to a one-line command the process of building rpms (e.g. from git) and then distributing them to a host (typically a VM) which is being used for testing.
For example,
build-dist-rpms -l -r external-smt -t 192.168.124.10 -p pacific \
~/SUSE/IBS/branches/Devel/Cloud/2.0/Staging/crowbar
does the following:
-
Invokes
build-rpms
to build an rpm:-
Invokes a helper to find the location of the git working tree on the local system which contains source corresponding to the package in the given directory. This helper is a trivial shell script which every developer can tweak to match their own
$HOME
layout. -
Rewrites the
url
parameter in the_service
file to point to that local git repository (that's the-l
option). -
Rewrites the
revision
parameter in the_service
file to beexternal-smt
. -
Runs
osc service disabledrun
. -
Restores the
_service
file to how it was before the above tweaks. -
Runs
osc build
with suitable parameters.
-
-
Invokes
dist-rpms
script to install that rpm on192.168.124.10
viarsync
,ssh
, andzypper
.In the example above, the
-p pacific
option even allows installation of an rpm via a proxy host, which is really useful when the host you are hacking on (e.g. your laptop) is different to the one (e.g. workstation) on which you are running your test VMs.
First download and install to somewhere on $PATH
, e.g.
git clone https://github.com/openSUSE/pack-tools.git
cp pack-tools/contrib/BS-pkg-testing/* ~/bin
mv ~/bin/source-dir-for.sample ~/bin/source-dir-for
Now adjust the config script to where you've checked out your OBS / IBS
packages and the corresponding git
repositories:
vim ~/bin/source-dir-for
Try building a package from local source and installing it into your test VM with a single command! e.g.
build-dist-rpms -d -t 192.168.124.10 ~/Devel/Cloud/2.0/Staging/crowbar
If you want to use a particular git branch, use the -r
option:
build-dist-rpms -r mybranch -t 192.168.124.10 ~/Devel/Cloud/2.0/Staging/crowbar
These scripts were originally announced here: