jjasghar / jenkinsfile_cookbook_pipeline

Example Jenkinsfile and Explaination for Chef Cookbook Development
36 stars 30 forks source link

Dokken comes up with error saying No cookbook directory found #4

Open sauravnz opened 6 years ago

sauravnz commented 6 years ago

I am running this on my Jenkins which is running in a container. It fails every time complaining that it did not find the cookbooks directory. Using the latest kitchen-dokken (2.6.7)

Would like to hear on how you got it working, if this has something to do with the newer kitchen-dokken gem or the fact that jenkins is also running in a container, it spins another chefdk container.

[centos] [2018-03-08T04:12:49+00:00] WARN: *****************************************
[centos] [2018-03-08T04:12:49+00:00] WARN: Did not find config file: /opt/kitchen/client.rb, using command line options.
[centos] [2018-03-08T04:12:49+00:00] WARN: *****************************************
[centos] [2018-03-08T04:12:49+00:00] WARN: No cookbooks directory found at or above current directory.  Assuming /.
[centos] [2018-03-08T04:12:49+00:00] WARN: No cookbooks directory found at or above current directory.  Assuming /.
[centos] [2018-03-08T04:12:49+00:00] FATAL: Cannot load configuration from /opt/kitchen/dna.json
[centos] [2018-03-08T04:12:49+00:00] FATAL: Cannot load configuration from /opt/kitchen/dna.json
maycson-ciandt commented 6 years ago

I have the same problem. Do you have any news about this problem ?

espoelstra commented 5 years ago

It seems like it might be attempting to run "docker-in-docker-in-docker" which might not work. Otherwise I've found that you need to ensure that the path being mapped into the inner container also exists on the host where your Jenkins Docker container is running even if empty, due to some quirk of how Docker handles the mounts if you have mapped in the /var/run/docker.sock. So if your host has something like /var/lib/jenkins_home:/opt/jenkins_home and this plugin is attempting to map $JENKINS_HOME/workspace/some_job you need to ensure at least the first portion of the path also exists on your host machine if I remember correctly.