3

I have three cookbooks 'A', 'B' and 'C'. Each cookbooks lives in it's own repo.

Cookbook 'B' depends on 'A' and I have entry for cookbook 'A' Berksfile, with source set to repo url

Cookbook 'C' depends on 'B' and I have entry for cookbook 'B' Berksfile, with source set to repo url

However upon running berks vendor on Berksfile of cookbook 'C', I see that berkshelf doesn't download cookbook 'A'

What am I doing wrong here

Pushkar
  • 541
  • 4
  • 18
  • Berkshelf only uses the local Berksfile. The Berksfile for cookbook "C" should contain the GIT URLs for cookbooks "A" and "B". That way it'll know from where to obtain the cookbook code associated with dependency declarations it discovers in the metadata files – Mark O'Connor Mar 04 '15 at 22:05

1 Answers1

2

The dependencies for your cookbook should be listed in the cookbook's metadata.rb file.

In your use case here, if cookbook A is dependent on cookbook B, you should have the following line in the metadata.rb file of your cookbook A.

depends 'B'

Now, coming to your Berksfile, the source is for the community cookbooks listed on the supermarket, unless you have your own supermarket instance standing somewhere. For the cookbooks that are not on supermarket use the "cookbook" in your Berksfile to list your dependency as shown in the example below:

source 'https://supermarket.getchef.com'

metadata

cookbook 'B', git:'http://<your_domain>/project/B', tag: 'some_tag'

Berkshelf handles cookbook dependencies based on the dependencies listed in your cookbook's metadata.rb.

jssnirmal
  • 78
  • 4