capistranoが楽しい

仕事でcapistranoを改修してますが、なかなか楽しいw

まずは、
https://github.com/jamis/capistrano-ext
これは、環境毎にフォルダを分けれるので、deploy.rbがすごいきれいになる。

config/deploy/production.rb
             /staging.rb

みたいな感じで使えます。

あとは、今更ながら発見したんですが、
namespace.taskでcallできるんですね・・・

namespace :deploy do
  task :test, do
    puts "test!!!"
  end
  task :start do
    call_test
  end
end

def call_test
  deploy.test
end

実行結果
cap production deploy:start
=> "test!!!"

いや楽しい!