namespace:deploydo# some other tasks...desc'Restart application'task:restart,:roles=>:appdorun"touch #{current_path}/tmp/restart.txt"endend
而 capistrano v3提供了一套新的 DSL,新的 deploy 脚本应该是:
namespace:deploydo# some other tasks...desc'Restart application'task:restartdoonroles(:app),in: :sequence,wait: 5doexecute:touch,release_path.join('tmp/restart.txt')endendend