tl; dr version: Can Berkshelf allow recursive dependencies in Git-based cookbooks, and if so, how?
I am trying to manage my cooks in a cookbook with Berkshelf. Cookbooks are stored in internal Git repositories. Dependencies are as follows:
env_dockerhub_dev >>depends on>> app_dockerhub >>depends on>> app_docker
The main Berks file in my project is as follows:
source "https://supermarket.chef.io" cookbook "env_dockerhub_dev", git: " git@URL _TO_GIT_SERVER/chef_env_dockerhub_dev.git"
The env_dockerhub_dev has metadata.rb , like this:
name 'env_dockerhub_dev' ... depends 'app_dockerhub' depends 'base_ubuntu'
and a Berksfile as follows:
source "https://supermarket.chef.io" cookbook "app_dockerhub", git: " git@URL _TO_GIT_SERVER/chef_app_dockerhub.git" cookbook "base_ubuntu", git: " git@URL _TO_GIT_SERVER/chef_base_ubuntu.git"
When I now run berks install , I get the following error message:
Resolving cookbook dependencies... Fetching 'env_dockerhub_dev' from git@URL _TO_GIT_SERVER/chef_env_dockerhub_dev.git (at master) Fetching cookbook index from https://supermarket.chef.io... Unable to satisfy constraints on package app_dockerhub, which does not exist, due to solution constraint (env_dockerhub_dev = 0.1.0). Solution constraints that may result in a constraint on app_dockerhub: [(env_dockerhub_dev = 0.1.0) -> (app_dockerhub >= 0.0.0)] Missing artifacts: app_dockerhub,base_ubuntu Demand that cannot be met: (env_dockerhub_dev = 0.1.0) Unable to find a solution for demands: env_dockerhub_dev (0.1.0)
I can fix this problem when I add all the Git URLs for all of my internal cookbooks to the βmainβ Berksfile (the Berksfile at the root of my project) as follows:
source "https://supermarket.chef.io" # the main cookbook cookbook "env_dockerhub_dev", git: " git@URL _TO_GIT_SERVER/chef_env_dockerhub_dev.git" # the cookbooks that are "recursively" cookbook "app_dockerhub", git: " git@gURL _TO_GIT_SERVER/chef_app_dockerhub.git" cookbook "app_docker", git: " git@URL _TO_GIT_SERVER/chef_app_docker.git"
In any case - I think that this should not be the solution to this problem.
Thanks a lot for your help!