spox / batali

Light weight cookbook resolver
https://spox.github.io/batali
Other
32 stars 6 forks source link

batali resolve - ERROR: Errno::ENOENT: No such file or directory #102

Closed mg03 closed 6 years ago

mg03 commented 6 years ago

hi chris

I have a directory for one project folder called chef-veda-logging with one site-cookbook in it

├── Batali ├── batali.manifest ├── how_to └── site-cookbooks └── veda-logging ├── Batali ├── Berksfile ├── Berksfile.lock ├── CHANGELOG.md ├── LICENSE ├── README.md ├── Vagrant_test_setup.rb ├── attributes │   └── default.rb ├── chefignore ├── metadata.rb ├── recipes │   ├── default.rb │   └── fluentd.rb ├── templates │   └── default │   ├── fluent.conf.erb │   ├── fluentd.service.erb │   ├── kubernetes.conf.erb │   ├── monitoring.conf.erb │   └── systemd.conf.erb └── test └── integration └── default └── serverspec ├── logging_spec.rb └── spec_helper.rb

The above is commited to git master with tag v0.3.0

Now in another folder lets say chef-veda-log-consume , I have created a Batali file like so

  source 'https://supermarket.chef.io'

  cookbook 'veda-logging', :git => 'git@githost.blah.com:user/chef-veda-logging.git', :ref => 'v0.3.0'

  blacklist = []

  Dir.new('site-cookbooks').each do |item|
    next if item.start_with?('.') or blacklist.include?(item)
    full_path = File.join('site-cookbooks', item)
    if(File.directory?(full_path))
      cookbook File.basename(item), :path => full_path
    end
  end

  discover true
end

when i do , batali resolve I get error

[ERROR]: Reason - No such file or directory - Failed to locate metadata file in cookbook directory! ERROR: Errno::ENOENT: No such file or directory - Failed to locate metadata file in cookbook directory!

I have a metadata.rb in the chef-veda-logging/site-cookbooks/veda-logging

Any pointers will be appreciated?

chrisroberts commented 6 years ago

@mg03 can you provide the output from the resolve command with the --debug flag enabled. Are you sure it's coming from the remote cookbook and not something located in the site-cookbooks directory?

mg03 commented 6 years ago

@chrisroberts : yup it was from remote cookbook which did not have a metadata.rb. This is resolved, user error. Thanx