The Source for Java Technology Collaboration
User: Password:



Kohsuke Kawaguchi

Kohsuke Kawaguchi's Blog

Debian packages of Hudson

Posted by kohsuke on June 11, 2008 at 05:14 PM | Comments (33)

I have started packaging up Hudson as a debian package.

To use it, you have to add the following line to your /etc/apt/sources.list

deb http://hudson.gotdns.com/debian binary/

After that, update your package list once:

$ sudo apt-get update

You can now install and update Hudson by just running

$ sudo apt-get install hudson

This sets up Hudson as a daemon that gets launched at boot. Refer to /etc/default/hudson to tweak some of the parameters. Big thank you goes to Amelia Lewis for sharing the scripts (and it looks like she's a web service person — the world is small!) This is my first Debian packaging effort, so I'm sure I'm doing things incorrectly. If you notice anything I need to do better, please let me know.

But hopefully this would simplify the installation, and more importantly upgrades, because that happens a lot. I think it would be also interesting to do a Ubuntu Live CD that has tools like Hudson, Subversion server, Sventon, Trac, Maven repository manager and so on, which you can either install on a virtual machine or on a real machine, to quickly get to the productive development envirnoment.

With this, Hudson now covers SUSE, FreeBSD, and Ubuntu! And the current plan is to attach OpenSolaris next.

If anyone can volunteer for RPMs or even just send me some pointers, I'd like to do RPMs, too. And oh, does anyone know if Windows have any package system? (And no, I'm not talking about *.msi)


Bookmark blog post: del.icio.us del.icio.us Digg Digg DZone DZone Furl Furl Reddit Reddit
Comments
Comments are listed in date ascending order (oldest first) | Post Comment

  • Kohsuke, that URL for openSUSE packages is outdated, by a large margin :-)

    for openSUSE 11.0
    for openSUSE 10.3
    for openSUSE 10.2
    for SUSE Linux Enterprise 10


    And if there's only room for a single link, then this one
    If you want to package RPMs for many distributions, it can be done in the openSUSE Build Service (openSUSE, SLE, Fedora, CentOS, Mandriva, RHEL). Debian/Ubuntu packages can be built there too. You don't need to have any local resources, there's a build farm behind it, it is free (just need to register an openSUSE account, which is also free), it has web and CLI interfaces, etc...
    More details here: http://en.opensuse.org/Build_Service
    (and an openSUSE RPM of hudson is already available there ;-))

    Posted by: pbleser on June 11, 2008 at 09:59 PM

  • About the openSUSE RPMs (post above): if you're looking for the RPM file itself and not the repository to add, just dive into the "noarch" subdirectory.

    Posted by: pbleser on June 11, 2008 at 10:06 PM

  • And last but not least, as a starting point, here are the files I'm using to build the openSUSE hudson rpm.

    As you publish releases so often, I also hacked a script (mix of Python, curl and lftp) that scrapes the Hudson changelog and download URL (as, unfortunately, dev.java.net cannot provide proper URLs), modifies the .spec file (the recipe for building RPMs) and downloads hudson.war

    One of the best resources to get started with building RPM packages is the official RPM Guide (from chapter 8 on), which is hosted by Fedora.

    Basically, in order to port my RPM to other distros, it is just a matter of proper dependency naming for the java package, writing an init script for each distro that differs in that area (i.e. one for Mandriva, one for CentOS+RHEL+Fedora) and the appropriate RPM "Group" tag for each.

    Posted by: pbleser on June 11, 2008 at 10:24 PM

  • Mate, are you building the packages with hudson? :)

    http://vafer.org/projects/jdeb/howto.html

    Posted by: tcurdt on June 12, 2008 at 12:47 AM

  • Just out of curiosity, are you using the maven debian plugin (from codehaus Mojo ?)

    Posted by: lacostej on June 12, 2008 at 06:39 AM

  • Pascal, thank you for the pointer to the newer stuff. I captured your information here. Now, I have to admit I've never touched SUSE, but how do you install them? There's an equivalent of yum/apt-get in SUSE, right?

    Posted by: kohsuke on June 12, 2008 at 04:03 PM


  • Torsten, good to hear from you! I'll definitely look at your plugin. Hudson package has /etc/init.d/hudson and so on, and I'm not quite sure how those things are handled by debhelper. Does your stuff work for that?


    lacostej — I didn't know about this plugin either, but if it doesn't support init script, it's not usable for me.

    Posted by: kohsuke on June 12, 2008 at 04:07 PM

  • Thanks Kohsuke, this will make it a lot easier to keep hudson up to date. It might be a good idea to by default make a user named hudson and run under that user instead of as root though.

    Posted by: pepijnve on June 13, 2008 at 12:06 AM

  • pepijnve — Yes. Now, the only question is, how do I do that? I looked at a list of dh_* commands but coudln't find anything obvious like "dh_adduser"

    Posted by: kohsuke on June 13, 2008 at 09:11 AM

  • Can't help you there I'm afraid. Maybe some inspiration can be found in for instance the tomcat package source. It creates a tomcat55 user on installation.

    Posted by: pepijnve on June 14, 2008 at 02:07 AM

  • According to the FHS (http://www.pathname.com/fhs/), you must not put the hudson.war into the /usr/local/bin directory. It is reserved for local administrators. According to the FHS you should place it into the /usr/share/hudsor/hudson.war (because it is architecture-independent file).

    Posted by: wfrag on August 11, 2008 at 10:56 PM

  • Thanks, I fixed to put hudson.war in /usr/share/hudson/hudson.war.

    Posted by: kohsuke on August 12, 2008 at 11:26 AM

  • Creating a hudson user with the home directory /var/hudson would be very cool. Debian control file you might add something like:

    preinst
    adduser --home /var/hudson hudson

    Great product Kohsuke!

    Posted by: kdocki on August 21, 2008 at 03:19 PM

  • You said:

    "I think it would be also interesting to do a Ubuntu Live CD that has tools like Hudson, Subversion server, Sventon, Trac, Maven repository manager and so on, which you can either install on a virtual machine or on a real machine, to quickly get to the productive development envirnoment. "

    This is *exactly* what I'm looking for for a demo I'm giving on these type of tools. Has anyone done this? Ideally, I'd love VMWare image configured with all of these tools up and running...then I'd be off to the races.

    Posted by: dmacpher on September 11, 2008 at 01:48 PM


  • kdocki — any chance you can write it in a patch? I wonder if it matters where I put those two lines in the "rules" file (it's not "control" file, right?


    dmacpher — I'm looking for people who'd be interested in working on this. If you know someone or yourself interested in this, let me know!

    Posted by: kohsuke on September 12, 2008 at 07:54 AM

  • On Debian-derived systems (tested on Ubuntu 8 and Debian 4), this error message occurs on startup:

    Caused by: java.lang.ClassNotFoundException: java.util.concurrent.CopyOnWriteArrayList not found in java.net.URLClassLoader{urls=[], parent=java.net.URLClassLoader{urls=[file:/tmp/winstonenr3b4ljar], parent=gnu.gcj.runtime.SystemClassLoader{urls=[file:/usr/share/hudson/hudson.war], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}}}

    Apparently the CopyOnWriteArrayList contains some non-free code that was removed by the Debian maintainers.

    Could you either use a different class or figure out the proper Debian dependencies? I'll try and figure them out by myself, but perhaps you could also take a look.

    Posted by: nczempin on October 02, 2008 at 04:16 AM

  • Okay, the above message occurs only on Debian 4, with my particular settings. gij is java 1.4.2, so it won't include the concurrency package.

    So the hudson package should have a java version dependency >= 1.5.

    The error I'm getting on Ubuntu is actually different:
    gnu.xml.datatype.JAXPDatatypeFactory

    java.lang.ClassNotFoundException: I'll try to find out what's happening there.

    Posted by: nczempin on October 02, 2008 at 04:40 AM

  • I meant java.lang.ClassNotFoundException: gnu.xml.datatype.JAXPDatatypeFactory, sorry.

    Posted by: nczempin on October 02, 2008 at 04:41 AM

  • It seems that Packages.gz is empty, this means It is not possible to install using apt-get!

    Is it a bug or intended?

    Posted by: chrisspelberg on October 14, 2008 at 03:25 AM

  • Dear All,

    I edited the /etc/apt/sources.list with deb http://hudson.gotdns.com/debian binary/

    After that, run $ sudo apt-get update, got the below output:

    ............

    Ign http://hudson.gotdns.com binary/ Release.gpg
    Ign http://hudson.gotdns.com binary/ Translation-en_US
    Hit http://security.ubuntu.com hardy-security Release.gpg
    Ign http://security.ubuntu.com hardy-security/main Translation-en_US
    Hit http://us.archive.ubuntu.com hardy Release.gpg
    Ign http://us.archive.ubuntu.com hardy/main Translation-en_US
    Ign http://hudson.gotdns.com binary/ Release
    Ign http://security.ubuntu.com hardy-security/restricted Translation-en_US
    Ign http://security.ubuntu.com hardy-security/universe Translation-en_US
    Ign http://security.ubuntu.com hardy-security/multiverse Translation-en_US
    Ign http://hudson.gotdns.com binary/ Packages
    Ign http://us.archive.ubuntu.com hardy/restricted Translation-en_US
    Ign http://us.archive.ubuntu.com hardy/universe Translation-en_US
    Ign http://us.archive.ubuntu.com hardy/multiverse Translation-en_US
    Get:1 http://us.archive.ubuntu.com hardy-updates Release.gpg [189B]
    Ign http://us.archive.ubuntu.com hardy-updates/main Translation-en_US
    Hit http://security.ubuntu.com hardy-security Release
    Get:2 http://hudson.gotdns.com binary/ Packages [20B]

    ............

    But when I run $ sudo apt-get install hudson, got below output:

    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    E: Couldn't find package hudson

    Can anyone help with this? What did I do wrong? Which steps did I miss?

    Thanks,
    Qiubo

    Posted by: qiubosu on October 22, 2008 at 03:14 PM

  • Kohsuke,

    The Packages.gz in your debian repo 'binary' directory is empty.
    Could you at some point run:

    dpkg-scanpackages binary /dev/null | gzip -9c > binary/Packages.gz

    from the debian dir to update the Packages.gz file properly?

    Thanks!

    Once that is done, the problem that Quibo and chrisspelberg have encountered will be resolved.

    Posted by: keithel on October 29, 2008 at 04:55 PM

  • I've received a:
    ClassNotFoundException: gnu.xml.datatype.JAXPDatatypeFactory

    error when installing and running hudson for the first time on Ubuntu Hardy (8.04)... I'm unclear which java package this may lie in... I would think it would be the gnu JAXP project, but I don't see that class in there...

    Anyone have any ideas or possible ways of getting past this?

    Here's the full error log:
    http://pastebin.com/m5e8b9d65 (valid for a month from today)

    Posted by: keithel on October 29, 2008 at 05:19 PM

  • Hi I am wondering if a similar problem as Qiubo was having is happening again?
    I get the following
    Ign http://hudson.gotdns.com binary/ Release.gpg
    Ign http://hudson.gotdns.com binary/ Translation-en_US
    Ign http://hudson.gotdns.com binary/ Release
    Ign http://hudson.gotdns.com binary/ Packages
    Get:20 http://hudson.gotdns.com binary/ Packages [20B]

    but an apt-cache search does not find hudson package

    Thanks

    Posted by: brianmcgillion on March 25, 2009 at 01:07 AM

  • Could you please set the HUDSON_HOME as HOME, too?
    This is really helpful for the git plugin because ".gitconfig" is searched in $HOME.

    I think the ".m2" repository is also searched there...

    Posted by: shake on March 25, 2009 at 02:06 PM

  • For me that line seems to work (/etc/init.d/hudson):

    DAEMON_ARGS="--name=$NAME --env=HOME=$HUDSON_HOME --env=HUDSON_HOME=$HUDSON_HOME --inherit --output=$HUDSON_LOG --user=$HUDSON_USER --pidfile=$PIDFILE"

    Posted by: shake on March 25, 2009 at 02:16 PM

  • Have you issued an ITP to move towards official Debian packages ?

    Posted by: oberger on April 08, 2009 at 08:18 AM

  • Kohsuke, your packages are STILL not working for the same reasons described by Quibo and chrisspelberg.

    Could you please update your package jobs as described by keithel on October 29, 2008 at 04:55 PM?

    I really hope you will do this, as the apt-get install method is much more convenient for us!

    Thanks a lot!

    /Jesper Rønn-Jensen
    www.justaddwater.dk

    Posted by: jesperronn on April 15, 2009 at 02:35 AM

  • Today it actually works. I see the file Packages.gz (http://hudson.gotdns.com/debian/binary/Packages.gz) is no longer empty :)

    Thanks! I hope that this service will prevail and will be working continuously as I'm writing it into an automated script for setting up my servers.

    Thanks!

    /Jesper

    Posted by: jesperronn on April 16, 2009 at 02:13 AM

  • For me the http://hudson.gotdns.com/debian/binary/Packages.gz is empty again.

    Posted by: tisoft_media on May 14, 2009 at 11:59 PM

  • http://hudson.gotdns.com/debian/binary/Packages.gz is empty again.
    Can you fix this?

    Posted by: mariusx on May 15, 2009 at 10:56 AM

  • I finally figured out why Packages.gz become empty --- I had a Hudson job that was trying to update this file, which wasn't working. I removed that, so this problem should be fixed once and for all.

    Posted by: kohsuke on May 16, 2009 at 11:48 AM

  • Thanks Kohsuke! I have Ubuntu 9.04 running hudson 1.308 perfectly. Make sure you run the sudo apt-get update as suggested!

    Posted by: phecht on May 29, 2009 at 04:27 PM

  • Some correction in the /etc/init.d/hudson script

    I have some problems with the maven svn-plugin.
    svn check-in / check-out does not work correctly with https urls if I start build process from hudson.

    The problem was in the HOME variable. After start it references to the /root and does not allow to import/read info in/from /.subversion directory.

    I add two entries into inid.d script, start part before daemon start
    export HOME=$HUDSON_HOME
    export USER=$HUDSON_USER

    Important: daemon params--env don't work correctly

    Of course you need login as hudson and import https certificate manually by
    svn checkout https://.... or another svn command (p)ermanently

    Posted by: vitalip on June 06, 2009 at 01:21 AM



Only logged in users may post comments. Login Here.


Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds