Skip to content

Instantly share code, notes, and snippets.

@morgoth
Created November 8, 2010 15:12
Show Gist options
  • Save morgoth/667788 to your computer and use it in GitHub Desktop.
Save morgoth/667788 to your computer and use it in GitHub Desktop.

Revisions

  1. morgoth renamed this gist Nov 9, 2010. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. morgoth created this gist Nov 8, 2010.
    12 changes: 12 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    # hack for the chef - we cannot read file in http_request resource
    ruby_block "Set attributes for http request for #{database[:name]} #{database[:kind]}" do
    block do
    request = resources(:http_request => "Create backup record for #{database[:name]} #{database[:kind]}")
    request.message({:backup => {:filename => compressed_file_name, :kind => database[:kind], :size => File.size(compressed_file_path)}})
    end
    end

    http_request "Create backup record for #{database[:name]} #{database[:kind]}" do
    url "http://some-url/backups"
    action :post
    end