Can you upload chef cookbooks directly from a hosted Git repository

chefgitknife

I'm learning Chef. My cookbooks are on Github. It seems the workflow goes:

  1. Install cookbooks locally (download them from Github with knife site install)
  2. Upload cookbooks to server (knife cookbook upload)
  3. Deploy to client from server (knife ssh ... "sudo chef-client")

Is there a way to combine 1 and 2? It's not critical, but sometimes I need to conserve bandwidth. And I'd like to know if I'm missing something.

Best Answer

Opscode made an opinionated choice to keep Chef & Git separate, and have spoken about it on multiple occasions - maybe someone else isn't using Git, maybe it shouldn't be as tied into source control as it is, etc.

Consider this: knife cookbook site install apache2 by default is not going to Github, rather the Community Site where cookbooks are released (similar to rubygems).

Keeping them separate also allows the flexibility of multiple people working on a cookbook, checking in their code, and finally, when you are ready, deploy it to the chef server as a unit of code to be deployed.

So in short, there's no built-in method to combine items 1&2.