How do I run a rake task from Capistrano?

前端 未结 16 2123
忘了有多久
忘了有多久 2020-11-28 02:18

I already have a deploy.rb that can deploy my app on my production server.

My app contains a custom rake task (a .rake file in the lib/tasks directory).

I\

16条回答
  •  旧巷少年郎
    2020-11-28 02:26

    Use the capistrano-rake gem

    Just install the gem without messing with custom capistrano recipes and execute desired rake tasks on remote servers like this:

    cap production invoke:rake TASK=my:rake_task
    

    Full Disclosure: I wrote it

提交回复
热议问题