[chef] Re: Re: Re: Jenkins and Chef


Chronological Thread 
  • From: Phil Oliva < >
  • To:
  • Cc: " " < >
  • Subject: [chef] Re: Re: Re: Jenkins and Chef
  • Date: Fri, 24 Oct 2014 19:17:56 -0400

Chris,

I haven't tried this yet but chef server replication might simplify things for you:

This is however a Chef 12 feature.
 
I recently have been looking to build a jenkins server for chef (with assumption of migrating to Chef 12) and using pipeline cookbook as a starting point:

- Phil


On Fri, Oct 24, 2014 at 5:56 PM, George Miranda < " target="_blank"> > wrote:
Using berkshelf might greatly relieve your pain.  Back in the day before berks, I would accomplish this with a parameterized knife.rb.  You can use $WORKSPACE in your knife.rb.  Here's a snippet from an older project's knife.rb file, where I expected different cookbook paths based upon different things going in different workspaces.

if File.exists?(File.join(ENV['WORKSPACE'], "chef-repo"))
  cookbook_path          ["#{ENV['WORKSPACE']}/chef-repo/cookbooks"]
elsif File.exists?(File.join(ENV['WORKSPACE'], "cookbooks"))
  cookbook_path          ["#{ENV['WORKSPACE']}/cookbooks"]
else
  cookbook_path          ["#{ENV['WORKSPACE']}"]
end

So you can do things like that.  But nowadays, I'd also recommend just looking at berks.




On Fri, Oct 24, 2014 at 2:20 PM, Dave Kichler < " target="_blank"> > wrote:
Are you using any sort of cookbook dependency management tool?  (Berkshelf, librarian, etc)  If not, it sounds like adopting one of those tools and installing/using it on Jenkins would greatly simplify your workflow.

Dave

On Fri, Oct 24, 2014 at 1:59 PM, Fouts, Chris < " target="_blank"> > wrote:

I’m trying to setup my existing RHEL Jenkins build slaves to orchestrate deploying and installing our product on multiple servers. I have a set of Jenkins jobs that deploy ProdA, and then a different, but similar, set of Jenkins jobs deploy ProdB. Both Jenkins job sets “can” be running on the “same” build slave. However, ProdA may require a different set of cookbooks that ProdB. Therefore, my solution is to checkout the corresponding set of cookbooks for ProdA and ProdB, and since each job set runs on a different Jenkins $WORKSPACE directory, my cookbooks directory locations do not clash. I can then have the Jenkins jobs upload their cookbooks to the server – so far so good.

 

However, how do I orchestrate my knife.rb file to point to the corresponding cookbook_path? Remember I’m doing two Jenkins job sets on the “same” build slave, meaning I’ll have one .chef/knife.rb file at any one time. I’m aware of the knife block plugin

 

Make sense?

 

Chris

 







Archive powered by MHonArc 2.6.16.

§