LoginSignup
9
9

More than 5 years have passed since last update.

Capistrano 3でcomposer installする

Posted at

Capistrano 3でPHPのアプリケーションをデプロイするとき、composer.lockを見てcomposer installをさせたい場合のタスクの書き方、簡単に。parallelで動かしてもいいかも。

namespace :deploy do
  after :updated, :composer_install do
    on roles(:app), in: :sequence, wait: 5 do
      execute "curl -sS http://getcomposer.org/installer | php -- --install-dir=#{release_path}"
      execute "cd #{release_path} && #{release_path}/composer.phar install --no-dev"
    end
  end
end

release_pathcomposer.pharを一度ダウンロードしているのでそれが気になる人はComposerを一度コマンドとしてインストールしておくなりするといいかも。composer self-updateするのが面倒なので都度ダウンロードするようにしています。

9
9
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
9
9