Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

cpan2rpm and Jenkins (not so perfect together?)

by blue_cowdawg (Monsignor)
on Mar 22, 2016 at 18:56 UTC ( #1158527=perlquestion: print w/replies, xml ) Need Help??

blue_cowdawg has asked for the wisdom of the Perl Monks concerning the following question:

In my continuing quest to make my life easier I've been trying to use Jenkins to stage distributions of software (and Puppet modules) for distribution into the production environment. Since I've been going great guns lately writing Perl based tools that's been including writing my own Perl modules.

I latched onto cpan2rpm as a way to create RPMs to allow Puppet to distribute my modules as needed. Works manually but doesn't seem to work from within a Jenkins job.

Anymonk have any experience with this?

Here is cpan2rpms last few words before the job exits abnormally:

+ cpan2rpm --no-sign . -- cpan2rpm - Ver: 2.028 -- Upgrade check Fetch: HTTP -- module: /var/lib/tomcat6/webapps/jenkins/workspace/Perl JSON -- Metadata retrieval Build step 'Execute shell' marked build as failure Finished: FAILURE

Unfortunately not very informative.

Peter L. Berghold -- Unix Professional
Peter -at- Berghold -dot- Net; Blog: Warning: No political correctness allowed.

Replies are listed 'Best First'.
Re: cpan2rpm and Jenkins (not so perfect together?)
by jeffa (Bishop) on Mar 22, 2016 at 19:20 UTC

    Remember that Jenkins runs under a different user and potentially uses a different perl than the one you installed the modules you use. Try to su as the Jenkins user and run the commands manually, hopefully you will see the solution then.


    (the triplet paradiddle with high-hat)

      I probably should have mentioned running cpan2rpm from the command line as tomcat (the user Jenkins runs as) worked without issue.

      Peter L. Berghold -- Unix Professional
      Peter -at- Berghold -dot- Net; Blog: Warning: No political correctness allowed.
Re: cpan2rpm and Jenkins (not so perfect together?)
by natxo (Scribe) on Mar 23, 2016 at 09:48 UTC
    not a puppet user (cfengine shop here), but what we do is create our own repository of rpm packages and distribute the repo information to all clients, so you can just use yum install yourpackage from the cfengine policies. It should not be very different using puppet/ansible/whatever.

    For creating repos we use mrepo (another battle tested tool) but many people use pulp or cobbler. You can even just use createrepo.

    What we do in jenkins is clone the production nfs volume where the repo data lives, we update the repos in this clone which is offered to the test clients (so patches are first tested there), and if after x days everything is fine then the cloned nfs volume gets promoted to production nfs volume. We have Netapp filers but you can easily achieve this with any zfs enabled filer.

      Yep, got that part down pat. And the creation of the repos is actually done by Puppet itself using a combination of the Exec type and a custom provider I cobbled together.

      I'm having trouble creating the RPMs from Jenkins using cpan2rpm. Running cpan2rpm from the command line as the Jenkins user works great but doing the same from a Jenkins job is crashing and burning without issuing good intel on why.

      I'm in the hopes somemonk has done this and figured out why this won't work inside a Jenkins job.

      Peter L. Berghold -- Unix Professional
      Peter -at- Berghold -dot- Net; Blog: Warning: No political correctness allowed.

        This isn't exactly an answer to your question, but I needed to use cpan2rpm a couple years ago and got pretty frustrated with it's limitations (doesn't work well with Module::Build modules was a big one). I ended up rewriting it (mine is called cpantorpm). It handles quite a few cases that cpan2rpm doesn't. It is NOT a drop-in replacement, but it may work where cpan2rpm doesn't (since I'm not a Jenkins user, I can't really say).

        Read about it here:CPANtoRPM

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1158527]
Approved by ww
Front-paged by ww
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (1)
As of 2023-05-28 10:45 GMT
Find Nodes?
    Voting Booth?

    No recent polls found