title: How to run a capistrano task within a whenever task?
body: <p>I have <code>whenever</code> gem setup properly. How can I run that <code>capistrano</code> from my <code>whenever</code> <code>schedule.rb</code>?</p>
  
  <p>my schedule.rb</p>
  
  <pre><code>every 1.minute, roles: [:app] do
     # how to run here a capistrano task
     # invoke 'my_app:test'
  end
  </code></pre>
  
  <p>My capistrano task:</p>
  
  <pre><code>namespace :my_app do
  
    desc 'test'
  
    task :test do
      on roles(:web) do
        puts "the task runs"
      end
    end
  end
  </code></pre>
  
  <p>Or should I move that task into a <code>rake</code> task. And should I run that rake task within <code>whenever</code> and <code>capistrano</code>?</p>