Trying to use Capistrano 3 to deploy a project and have run into an issue. In one of my tasks I'm trying to change directories and then run composer install.
For the life of me I can't get it to cd
into the proper folder.
Right now if I do
set :theme_path, "#{release_path}/web/app/themes/sage"
append :linked_dirs, "web/app/uploads"
append :linked_files, ".env"
set :keep_releases, 3
namespace :deploy do
desc "Build"
after :updated, :build do
on roles(:app) do
within release_path do
execute :composer, "install --no-dev --quiet"
execute :cd, "#{fetch(:theme_path)}; composer install --no-dev --quiet"
end
end
end
end
It's for some reason running it in the previous release. Doing a pwd
instead of the composer install
shows that it is inside /current/ and not in the new /release/ directory. So it runs my composer install in current, and then does all the symlinking, so I end up with it always running composer in the previous deploy, so my current deploy never works.
So if release_path
is /current/ and not the release currently being deployed... how do I get that path? Or how should I go about running composer install
in two places?