# Using ChefDK on a CI server?

**URL:** <https://discourse.chef.io/t/using-chefdk-on-a-ci-server/5315>\
**Category:** Chef Infra (archive)\
**Created:** [May 17, 2014, 11:01am UTC](https://discourse.chef.io/t/using-chefdk-on-a-ci-server/5315 "2014-05-17T11:01:15Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Steffen\_Gebert1](https://avatars.discourse-cdn.com/v4/letter/s/e56c9b/32.png) [@Steffen\_Gebert1](https://discourse.chef.io/u/Steffen_Gebert1)\
**Post date:** [May 17, 2014, 11:01am UTC](https://discourse.chef.io/t/using-chefdk-on-a-ci-server/5315/1 "2014-05-17T11:01:15Z")

</div>

Hi,

I try to set up a CI server using Jenkins for our cookbook testing and  
finally uploading to Chef server.

Would you recommend to use ChefDK to run test-kitchen, Berkshelf and so  
on, or should I use Bundler and respect the gem versions specified in  
the Gemfile?

Thanks for your opinion  
Steffen

---

<div class="post-metadata">

**Author:** ![Morgan\_Blackthorne](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/morgan_blackthorne/32/100_2.png) [@Morgan\_Blackthorne](https://discourse.chef.io/u/Morgan_Blackthorne)\
**Post date:** [May 17, 2014, 11:08am UTC](https://discourse.chef.io/t/using-chefdk-on-a-ci-server/5315/2 "2014-05-17T11:08:14Z")

</div>

I'm actually just trying that out (right now blocked on Berkshelf problems)  
myself with Bamboo. I am actually wondering if someone will write an  
updater cookbook like omnibus-updater, and implement resources like  
"chefdk\_gem 'knife-ec2'" would be viable so that the CI server config and  
chefdk configurations could be managed under Chef.

--  
~_~ StormeRider ~_~

"Every world needs its heroes [...] They inspire us to be better than we  
are. And they protect from the darkness that's just around the corner."

(from Smallville Season 6x1: "Zod")

On why I hate the phrase "that's so lame"... [http://bit.ly/Ps3uSS](http://bit.ly/Ps3uSS)

On Sat, May 17, 2014 at 4:01 AM, Steffen Gebert [st+gmane@st-g.de](mailto:st+gmane@st-g.de) wrote:

> Hi,
> 
> I try to set up a CI server using Jenkins for our cookbook testing and  
> finally uploading to Chef server.
> 
> Would you recommend to use ChefDK to run test-kitchen, Berkshelf and so  
> on, or should I use Bundler and respect the gem versions specified in  
> the Gemfile?
> 
> Thanks for your opinion  
> Steffen

---

<div class="post-metadata">

**Author:** ![Steffen\_Gebert1](https://avatars.discourse-cdn.com/v4/letter/s/e56c9b/32.png) [@Steffen\_Gebert1](https://discourse.chef.io/u/Steffen_Gebert1)\
**Post date:** [May 17, 2014, 11:47am UTC](https://discourse.chef.io/t/using-chefdk-on-a-ci-server/5315/3 "2014-05-17T11:47:32Z")

</div>

In regard to that:

> I am actually wondering if someone [..] implement resources like  
> "chefdk\_gem"

> <https://stackoverflow.com/questions/23680177/installing-gem-into-chefdk-via-chef>

🙂

Steffen

On 17/05/14 13:08, Morgan Blackthorne wrote:

> I'm actually just trying that out (right now blocked on Berkshelf problems)  
> myself with Bamboo. I am actually wondering if someone will write an  
> updater cookbook like omnibus-updater, and implement resources like  
> "chefdk\_gem 'knife-ec2'" would be viable so that the CI server config and  
> chefdk configurations could be managed under Chef.
> 
> --  
> ~_~ StormeRider ~_~
> 
> "Every world needs its heroes [...] They inspire us to be better than we  
> are. And they protect from the darkness that's just around the corner."
> 
> (from Smallville Season 6x1: "Zod")
> 
> On why I hate the phrase "that's so lame"... [http://bit.ly/Ps3uSS](http://bit.ly/Ps3uSS)
> 
> On Sat, May 17, 2014 at 4:01 AM, Steffen Gebert [st+gmane@st-g.de](mailto:st+gmane@st-g.de) wrote:
> 
> > Hi,
> > 
> > I try to set up a CI server using Jenkins for our cookbook testing and  
> > finally uploading to Chef server.
> > 
> > Would you recommend to use ChefDK to run test-kitchen, Berkshelf and so  
> > on, or should I use Bundler and respect the gem versions specified in  
> > the Gemfile?
> > 
> > Thanks for your opinion  
> > Steffen

---

<div class="post-metadata">

**Author:** ![Morgan\_Blackthorne](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/morgan_blackthorne/32/100_2.png) [@Morgan\_Blackthorne](https://discourse.chef.io/u/Morgan_Blackthorne)\
**Post date:** [May 17, 2014, 11:54am UTC](https://discourse.chef.io/t/using-chefdk-on-a-ci-server/5315/4 "2014-05-17T11:54:44Z")

</div>

Upvoted! 🙂

--  
~_~ StormeRider ~_~

"Every world needs its heroes [...] They inspire us to be better than we  
are. And they protect from the darkness that's just around the corner."

(from Smallville Season 6x1: "Zod")

On why I hate the phrase "that's so lame"... [http://bit.ly/Ps3uSS](http://bit.ly/Ps3uSS)

On Sat, May 17, 2014 at 4:47 AM, Steffen Gebert [st+gmane@st-g.de](mailto:st+gmane@st-g.de) wrote:

> In regard to that:
> 
> > I am actually wondering if someone [..] implement resources like  
> > "chefdk\_gem"
> 
> [Installing Gem into ChefDK via Chef - Stack Overflow](http://stackoverflow.com/questions/23680177/installing-gem-into-chefdk-via-chef)  
> 🙂
> 
> Steffen
> 
> On 17/05/14 13:08, Morgan Blackthorne wrote:
> 
> > I'm actually just trying that out (right now blocked on Berkshelf  
> > problems)  
> > myself with Bamboo. I am actually wondering if someone will write an  
> > updater cookbook like omnibus-updater, and implement resources like  
> > "chefdk\_gem 'knife-ec2'" would be viable so that the CI server config and  
> > chefdk configurations could be managed under Chef.
> > 
> > --  
> > ~_~ StormeRider ~_~
> > 
> > "Every world needs its heroes [...] They inspire us to be better than we  
> > are. And they protect from the darkness that's just around the corner."
> > 
> > (from Smallville Season 6x1: "Zod")
> > 
> > On why I hate the phrase "that's so lame"... [http://bit.ly/Ps3uSS](http://bit.ly/Ps3uSS)
> > 
> > On Sat, May 17, 2014 at 4:01 AM, Steffen Gebert [st+gmane@st-g.de](mailto:st+gmane@st-g.de)  
> > wrote:
> > 
> > > Hi,
> > > 
> > > I try to set up a CI server using Jenkins for our cookbook testing and  
> > > finally uploading to Chef server.
> > > 
> > > Would you recommend to use ChefDK to run test-kitchen, Berkshelf and so  
> > > on, or should I use Bundler and respect the gem versions specified in  
> > > the Gemfile?
> > > 
> > > Thanks for your opinion  
> > > Steffen

---

<div class="post-metadata">

**Author:** ![Lamont\_Granquist\_OLD](https://avatars.discourse-cdn.com/v4/letter/l/7feea3/32.png) [@Lamont\_Granquist\_OLD](https://discourse.chef.io/u/Lamont_Granquist_OLD)\
**Post date:** [May 17, 2014, 9:33pm UTC](https://discourse.chef.io/t/using-chefdk-on-a-ci-server/5315/5 "2014-05-17T21:33:34Z")

</div>

if you run chef-client out of the chefdk path, doesn't chef\_gem install  
into the embedded ruby?

something like:

#!/opt/chefdk/bin/chef-apply

chef\_gem "kitchen-docker"

that might go into the ~/.chefdk directory of the user installing it  
though so might not be ideal if you run it as root (not sure...)

On 5/17/14, 4:47 AM, Steffen Gebert wrote:

> In regard to that:
> 
> > I am actually wondering if someone [..] implement resources like  
> > "chefdk\_gem"  
> > [Installing Gem into ChefDK via Chef - Stack Overflow](http://stackoverflow.com/questions/23680177/installing-gem-into-chefdk-via-chef)  
> > 🙂
> 
> Steffen
> 
> On 17/05/14 13:08, Morgan Blackthorne wrote:
> 
> > I'm actually just trying that out (right now blocked on Berkshelf problems)  
> > myself with Bamboo. I am actually wondering if someone will write an  
> > updater cookbook like omnibus-updater, and implement resources like  
> > "chefdk\_gem 'knife-ec2'" would be viable so that the CI server config and  
> > chefdk configurations could be managed under Chef.
> > 
> > --  
> > ~_~ StormeRider ~_~
> > 
> > "Every world needs its heroes [...] They inspire us to be better than we  
> > are. And they protect from the darkness that's just around the corner."
> > 
> > (from Smallville Season 6x1: "Zod")
> > 
> > On why I hate the phrase "that's so lame"... [http://bit.ly/Ps3uSS](http://bit.ly/Ps3uSS)
> > 
> > On Sat, May 17, 2014 at 4:01 AM, Steffen Gebert [st+gmane@st-g.de](mailto:st+gmane@st-g.de) wrote:
> > 
> > > Hi,
> > > 
> > > I try to set up a CI server using Jenkins for our cookbook testing and  
> > > finally uploading to Chef server.
> > > 
> > > Would you recommend to use ChefDK to run test-kitchen, Berkshelf and so  
> > > on, or should I use Bundler and respect the gem versions specified in  
> > > the Gemfile?
> > > 
> > > Thanks for your opinion  
> > > Steffen

---

<div class="post-metadata">

**Author:** ![kallistec](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/kallistec/32/23_2.png) [@kallistec](https://discourse.chef.io/u/kallistec)\
**Post date:** [May 17, 2014, 9:51pm UTC](https://discourse.chef.io/t/using-chefdk-on-a-ci-server/5315/6 "2014-05-17T21:51:30Z")

</div>

On Saturday, May 17, 2014 at 2:33 PM, Lamont Granquist wrote:

> if you run chef-client out of the chefdk path, doesn't chef\_gem install  
> into the embedded ruby?
> 
> something like:
> 
> #!/opt/chefdk/bin/chef-apply
> 
> chef\_gem "kitchen-docker"
> 
> that might go into the ~/.chefdk directory of the user installing it  
> though so might not be ideal if you run it as root (not sure...)
> 
> On 5/17/14, 4:47 AM, Steffen Gebert wrote:
> 
> > In regard to that:
> > 
> > > I am actually wondering if someone [..] implement resources like  
> > > "chefdk\_gem"
> > 
> > [Installing Gem into ChefDK via Chef - Stack Overflow](http://stackoverflow.com/questions/23680177/installing-gem-into-chefdk-via-chef)  
> > 🙂
> > 
> > Steffen

The simplest thing you can do is add the `--no-user` option to the install, which will install to the embedded gem path instead of the user gem path. It does feel a bit wrong, but we haven’t observed any issues doing this with chef-client omnibus installs so it should be okay.

--  
Daniel DeLeo

---

<div class="post-metadata">

**Author:** ![Jesse\_Mauntel](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/jesse_mauntel/32/319_2.png) [@Jesse\_Mauntel](https://discourse.chef.io/u/Jesse_Mauntel)\
**Post date:** [May 18, 2014, 8:34pm UTC](https://discourse.chef.io/t/using-chefdk-on-a-ci-server/5315/7 "2014-05-18T20:34:26Z")

</div>

Steffen,

Here’s and example of how we do it in Jenkins. It’s worked out wondrously.

[http://devopslove.blogspot.com](http://devopslove.blogspot.com)[http://devopslove.blogspot.com/?m=1](http://devopslove.blogspot.com/?m=1)

On May 17, 2014, at 14:52, “Daniel DeLeo” \<[dan@kallistec.com](mailto:dan@kallistec.com)[mailto:dan@kallistec.com](mailto:dan@kallistec.com)\> wrote:

On Saturday, May 17, 2014 at 2:33 PM, Lamont Granquist wrote:

if you run chef-client out of the chefdk path, doesn’t chef\_gem install  
into the embedded ruby?

something like:

#!/opt/chefdk/bin/chef-apply

chef\_gem “kitchen-docker”

that might go into the ~/.chefdk directory of the user installing it  
though so might not be ideal if you run it as root (not sure…)

On 5/17/14, 4:47 AM, Steffen Gebert wrote:  
In regard to that:

I am actually wondering if someone […] implement resources like  
"chefdk\_gem"

> <https://stackoverflow.com/questions/23680177/installing-gem-into-chefdk-via-chef>

  
🙂

Steffen

The simplest thing you can do is add the `--no-user` option to the install, which will install to the embedded gem path instead of the user gem path. It does feel a bit wrong, but we haven’t observed any issues doing this with chef-client omnibus installs so it should be okay.

–  
Daniel DeLeo
