tl; dr versione: Berkself è in grado di risolvere le dipendenze ricorsive all'interno dei libri di cucina basati su Git e se sì - come?Risolvi le dipendenze ricettive della git cookbook con Berks
Provo a gestire le dipendenze del mio libro di cucina Chef con Berkshelf. I libri di cucina sono tutti archiviati in repository Git interni. Le dipendenze sono i seguenti:
env_dockerhub_dev
>>depends on>> app_dockerhub
>>depends on>> app_docker
Il Berksfile principale nel mio progetto si presenta così:
source "https://supermarket.chef.io"
cookbook "env_dockerhub_dev", git: "[email protected]_TO_GIT_SERVER/chef_env_dockerhub_dev.git"
Il env_dockerhub_dev
libro di cucina ha un metadata.rb
come questo:
name 'env_dockerhub_dev'
...
depends 'app_dockerhub'
depends 'base_ubuntu'
e Berksfile
come this:
source "https://supermarket.chef.io"
cookbook "app_dockerhub", git: "[email protected]_TO_GIT_SERVER/chef_app_dockerhub.git"
cookbook "base_ubuntu", git: "[email protected]_TO_GIT_SERVER/chef_base_ubuntu.git"
Quando ora corro berks install
ottengo il seguente messaggio di errore:
Resolving cookbook dependencies...
Fetching 'env_dockerhub_dev' from [email protected]_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)
posso risolvere il problema, quando aggiungo tutti gli URL Git per tutti i miei libri di cucina interni nella "principale" Berksfile (il Berksfile in la radice del mio progetto) come questo:
source "https://supermarket.chef.io"
# the main cookbook
cookbook "env_dockerhub_dev", git: "[email protected]_TO_GIT_SERVER/chef_env_dockerhub_dev.git"
# the cookbooks that are "recursively"
cookbook "app_dockerhub", git: "[email protected]_TO_GIT_SERVER/chef_app_dockerhub.git"
cookbook "app_docker", git: "[email protected]_TO_GIT_SERVER/chef_app_docker.git"
Comunque - penso che questo non dovrebbe essere la soluzione per questo problema.
Grazie mille per il vostro aiuto!