tags:

views:

669

answers:

4

I've a C project set up in Hudson doing nighly builds, i've also an .rpm spec file used for creating rpms from these sources.

Does anyone have any experience on how to build rpms out of all this using Hudson ?

Right now the only solution I see is to set up a job running a script that checks svn exports the sources ,creates a tarball and does the whole rpm build. This doesn't seem to integrate well with Hudson - e.g. how do I collect the artifacts ?

+1  A: 

I have not done it myself but would think you could have Hudson build the rpms but with the rpm build area being within the Hudson workspace. Then you would be able to link to the rpms as artifacts.

Here is how you use a different build area with rpm.

Mark
+1  A: 

What are you using as build tool on hudson? Make?

You can create a directory structure that rpm build will use in the Workspace of the Hudson Job - this can already be in the checkout that Hudson does, or it can be created separately by your build script. From this directory you can create your rpms (using an external process that you launch from Hudson?). Afterward you can copy the resulting rpm to the artifacts directory using the normal Hudson configure settings. (Hudson defines a number of environment variables that you can use - the workspace location is one of them)

Simon Groenewolt
+1  A: 

Not sure if I've got a very good answer to your question.

This has worked for me, but feels overweight for your needs.

I've had a decent amount of success with this by using the maven rpm plugin http://mojo.codehaus.org/rpm-maven-plugin/ basically a DSL for creating spec files, laying out sources, etc.

The upside is a maven artifact that hudson can more easily track.

I've added a little groovy script in the maven build (http://docs.codehaus.org/display/GMAVEN/Executing+Groovy+Code) for my needs at the end to auto update a yum repository that hosts the builds, but in your situation, I'd probably use the script before the rpm plugin is used to call make.

Honestly, I feel the above solution is a bit weighty, mostly due to the verbosity of doing scripting in maven, but it does work, and for us, with a bunch of java developers who know maven, works well.

JoeBoo
A: 

Ant can be used to build RPM's via the built-in RPM task. You can compile C sources with Ant with the CC task (from Ant-contrib).

Then you can use Hudson to build and package our software.

Daniel Voina

related questions