Skip to content

Instantly share code, notes, and snippets.

@josephholsten
Created February 22, 2013 21:58
Show Gist options
  • Save josephholsten/5016869 to your computer and use it in GitHub Desktop.
Save josephholsten/5016869 to your computer and use it in GitHub Desktop.
rake tasks
task :upload_all do
sh 'knife environment from file environments/*.rb'
sh 'knife role from file roles/*.rb'
sh 'knife data_bag from file -a'
sh 'knife cookbook upload -a'
end
desc "Runs foodcritic linter"
task :foodcritic do
if Gem::Version.new("1.9.2") <= Gem::Version.new(RUBY_VERSION.dup)
sh "foodcritic cookbooks"
else
puts "WARN: foodcritic run is skipped as Ruby #{RUBY_VERSION} is < 1.9.2."
end
end
task :default => [:foodcritic, :upload_all]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment