2017-09-05 112 views
0

我有whenever寶石安裝正確。我如何運行capistrano從我的wheneverschedule.rb如何在每次任務中運行一個capistrano任務?

我schedule.rb

every 1.minute, roles: [:app] do 
    # how to run here a capistrano task 
    # invoke 'my_app:test' 
end 

我Capistrano的任務:

namespace :my_app do 

    desc 'test' 

    task :test do 
    on roles(:web) do 
     puts "the task runs" 
    end 
    end 
end 

或者我應該動議的任務變成了rake任務。我應該在whenevercapistrano範圍內運行該耙子任務嗎?

回答

0

我會建議你的後一種選擇,將邏輯移動到rake任務,並在每當和Capistrano執行它。這樣做會更容易,更乾淨。

相關問題