Skip to content

Instantly share code, notes, and snippets.

@mattd
Created April 2, 2010 04:21
Show Gist options
  • Save mattd/352747 to your computer and use it in GitHub Desktop.
Save mattd/352747 to your computer and use it in GitHub Desktop.
include_recipe "python"
include_recipe "git"
bash "compile_blogofile_source" do
cwd "/tmp"
code <<-EOH
git clone #{node[:blogofile][:git_repo]}
cd blogofile
python setup.py install
EOH
creates node[:blogofile][:src_binary]
not_if do node[:blogofile][:src_binary] end
end
@EnigmaCurry
Copy link

is this used as a post-commit hook?

@mattd
Copy link
Author

mattd commented Apr 9, 2010

Actually, it's part of some experimentation I've been doing with the server configuration tool Chef.

http://github.com/mattd/chef-repo/blob/master/site-cookbooks/blogofile/recipes/source.rb

I used blogofile as my test case for using Chef, and though it's kind of overkill for a tool like blogofile, it sure works well. In the end, I bootstrap a VM with Chef, and then tell it to be a blogofile server using a recipe that looks like this:

http://github.com/mattd/chef-repo/blob/master/site-cookbooks/bytexbyte/recipes/default.rb

And bam! all set up with a ssh-auth'd git server with all the needed directories, nginx running properly, etc. All I have to do then is push my blogofile repo to the git server Chef has setup and my site is live.

If you're interested in Chef, let me know and we can chat. The docs are in a state of flux, and it's difficult to get started, but well worth it if you're looking for something like it.

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