Skip to content

Instantly share code, notes, and snippets.

@iafonov
Created Aug 14, 2012
Embed
What would you like to do?
Chef git templates

Chef git templates

Chef should allow creating cookbooks and chef-repo using templates. It should maintain the ability to create artifacts offline but a special switch could be supplied to knife wich will tell it to clone the remote repository rather than create a hardcoded structure.

Use cases:

knife chef-repo create --template https://github.com/fnichol/chef-bootstrap-repo knife cookbook create ntpd --template https://github.com/test/cookbook-with-minitest-and-berkshelf

Basically knife should clone the repository into folder and remove .git directory.

The idea could be pushed to 11 by following the same implementation as rails uses. (http://edgeguides.rubyonrails.org/rails_application_templates.html)

@fnichol
Copy link

fnichol commented Aug 14, 2012

This is a great idea! I feature I use a lot when creating Rails applications. Plus Thor has some nice functionality like prompting if a file already exists (overwrite, keep existing, show diff, etc.).

@erikh
Copy link

erikh commented Aug 14, 2012

I wrote a small ERB templating system that integrates with highline to ask questions: https://github.com/erikh/askerb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment