Skip to content

Instantly share code, notes, and snippets.

@mmarschall
Created November 8, 2010 15:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mmarschall/667810 to your computer and use it in GitHub Desktop.
Save mmarschall/667810 to your computer and use it in GitHub Desktop.
Rake task for uploading all data bags to the chef server using knife
desc "Upload all json files from data bag BAG"
task :upload_data_bags do
bag = ENV['BAG'] || raise("Usage: rake upload_data_bags BAG=apps")
Dir[File.join(File.dirname(__FILE__), 'data_bags', bag, '**')].each do |file|
puts `knife data bag from file #{bag} #{File.basename(file)}`
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment