Uploading spec folder to Chef Server


#1

Hi,

I unable to upload spec folder containing all unit test files to chef server for some reason.

Deleted spec*,test* lines from chefignore file still no luck. Please advise.


#2

The cookbooks on chef-server don't need either of those directories to function, those are purely there for development purposes. Is there a specific reason you think you need them on chef-server?


#3

I need to share it with other groups where before pushing to PROD they would run recipe locally in their dev boxes.

Is it possible in chef to allows test file to server?


#4

That is what Git (or your other source control system of choice) is for. Chef Server is for released artifacts only.


#5

Yes I do agree. GIT or other repo's are meant for it. But here I am talking about across teams.

In my work area the model we follow is little different. Different teams creates the cookbooks and one centralized chef team validates it and pushes into pipeline.

If you say it's not possible with in CHEF then we can close this thread. I am aware about GIT option that you are mentioning.

To add to that this is what chefifgnore file says

Put files/directories that should be ignored in this file when uploading

to a chef-server or supermarket.

I removed spec* from it and expecting it to upload to chef-server.


#6

What is the reason you unable to share your git repo across teams? Normally you don't ignore your testing infra whether its chefspec, inspec or some other. Look at any of the public cookbooks and you can see what the normal .gitignore contains. Another recomendation is to use the chef generate https://docs.chef.io/ctl_chef.html process as it generates a .gitignore for you. It sounds like your Chef Team is trying to standardize the process. Building a templateing system is a great way to start for them. By using the chef generate generator option.


#7

Technically this should be possible with current versions of Chef but it's not a use case we test so if something is wrong we welcome a bug report but you'll need to do a lot of the debugging and analysis legwork yourself (or hire someone to do it for you).