Created
November 8, 2010 15:26
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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