2012-08-27 08:24:25 +02:00
|
|
|
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}"
|
2013-01-07 13:44:46 +01:00
|
|
|
Rake::Task[task_to_run].execute
|
2012-08-27 08:24:25 +02:00
|
|
|
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']}"
|
2013-01-07 13:44:46 +01:00
|
|
|
Rake::Task[task_to_run].execute
|
2012-12-24 12:50:37 +01:00
|
|
|
end
|
|
|
|
|
2013-01-07 13:44:46 +01:00
|
|
|
end
|