LoginSignup
1
0

More than 5 years have passed since last update.

特定のサーバにCapistranoデプロイする時、任意のcallbackを削除する

Posted at

たとえば、バッチサーバにdeployする時はassetsで付与されたタスクを無効化する。

config/deploy/batch.rb
callbacks[:before].delete_if{|c| c.source == "deploy:assets:symlink"}
callbacks[:after].delete_if{|c| c.source == "deploy:assets:precompile"}

そもそも不用なcallbackをロードしない

Capfileで

load 'deploy/assets'

とする代わりに、assetsを必要とするサーバでのみload 'deploy/assets'してやるという解決策もあるかもしれない。

今回はassetsを有効化するサーバの数に対してバッチサーバの方が小数であったためこの方法を使った。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0