foodsoft/lib/tasks/multicoops.rake

21 lines
648 B
Ruby
Raw Normal View History

namespace :multicoops do
desc 'Runs a specific rake task for each registered foodcoop, use rake multicoops:run db:migrate'
task :run => :environment do
task_to_run = ARGV[1]
FoodsoftConfig.each_coop do |coop|
puts "Run '#{task_to_run}' for #{coop}"
Rake::Task[task_to_run].execute
end
end
2012-12-24 12:50:37 +01:00
desc 'Runs a specific rake task for a single coop, use rake mutlicoops:run_single db:migrate FOODCOOP=demo'
task :run_single => :environment do
task_to_run = ARGV[1]
FoodsoftConfig.select_foodcoop ENV['FOODCOOP']
puts "Run '#{task_to_run}' for #{ENV['FOODCOOP']}"
Rake::Task[task_to_run].execute
2012-12-24 12:50:37 +01:00
end
end