Support Cookbook Uploads
Opened this issue · 4 comments
As a user, I would like to be able to upload cookbooks using the go-chef/chef library.
Ruby Chef Cookbook Uploader: https://github.com/chef/chef/blob/main/lib/chef/cookbook_uploader.rb
General Process:
- Parse local cookbook, generating checksums for all cookbook files.
- Create a sandbox with the generated checksums to determine which files will need to be uploaded.
- Use
chef.Sandbox
Post
- Use
- Upload each cookbook file into the sandbox that has
needs_upload
set to true in thechef.Sandbox
Post
JSON response by performing a PUT to the provided sandbox itemurl
. - Commit the sandbox.
- Use
chef.Sandbox
Put
- Use
- Upload the cookbook version manifest.
I am currently taking a look at implementing this and submitting a PR.
Cool. Just to note I've never been able to get the sandbox api client to work at all.
Cool. Just to note I've never been able to get the sandbox api client to work at all.
I haven't had any trouble with it so far, but it may be due to different Chef Server versions (I've been working with Chef Server 15). Were you seeing issues against Chef Server, CINC Server, or Goiardi?
I usually test against the current chef server. The test suite for this project has a cookbook that spins up a chef server I run the integration tests against and where I do development. Good to hear you have it working.