Created
November 12, 2015 02:02
-
-
Save nappa32/8793a7722e3b73380c5b to your computer and use it in GitHub Desktop.
rake multitask example
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
task :task1 => [:big_db_task] do | |
sleep 1 | |
puts "Task 1" | |
end | |
task :big_db_task do | |
puts "Big db task" | |
end | |
task :task3 => [:big_db_task] do | |
puts "Task 3" | |
end | |
task :task4 => [:big_db_task] do | |
puts "Task 4" | |
end | |
task :rollups do | |
puts "running rollups" | |
end | |
task :run_reports => [:rollups] do | |
puts "Run Reports" | |
end | |
task :basecamp_upload => [:run_reports] do | |
puts "Basecamp upload" | |
end | |
task :new_task do | |
Rake::Task[:mytask].enhance([:task4]).invoke | |
end | |
multitask :mytask => [:task1, :task3, :rollups, :run_reports, :basecamp_upload] do | |
puts "Completed parallel execution of tasks 1 through 3." | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment