[英]Order Rake Tasks
I've read a lot but i'm confused. 我读了很多书,但我很困惑。
I'm trying to order the execution of my Rake tasks but haven't any luck yet. 我正在尝试命令执行Rake任务,但还没有任何运气。 The Task looks like this:
该任务如下所示:
task :populate do
# 1st in Order
Rake::Task['import0'].invoke
Rake::Task['import00'].invoke
# 2nd in Order
Rake::Task['import000'].invoke
Rake::Task['import0000'].invoke
# 3rd in Order
Rake::Task['import000000'].invoke
# 4th in Order
Rake::Task['import1'].invoke
Rake::Task['import2'].invoke
Rake::Task['import3'].invoke
# 5th in Order
Rake::Task['importA'].invoke
Rake::Task['importB'].invoke
Rake::Task['importC'].invoke
end
How can i order the execution of invokes being called. 我如何命令执行被调用的调用。 Do i have to call it from the Initial Tasks itself?
我是否必须从“初始任务”本身中调用它?
Yes, you can set the order when they are called. 是的,您可以在调用它们时设置顺序。
With a maximum of 3 in each set, I would do it this way: 每组最多3个,我可以这样进行:
TASKS = [ :import0, :import00, :import000, :import0000, :import000000,
:import1, :import2, :import3,
:importA, :importB, :importC ]
TASKS.each do |t|
Rake::Task[t.to_s].invoke
end
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.