Skip to content

Commit

Permalink
Fix: Issue capistrano#122, calling symfony_command is executed multip…
Browse files Browse the repository at this point in the history
…le times when multiple servers are defined
  • Loading branch information
csabavirag committed Jan 18, 2021
1 parent 24dc040 commit 0182ad8
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions lib/capistrano/tasks/symfony.rake
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ namespace :symfony do
role = args[:role] || fetch(:symfony_roles)
params = args[:params] || ''

on release_roles(role) do
within release_path do
symfony_console(command, params)
end
within release_path do
symfony_console(command, params)
end

Rake::Task[t.name].reenable
Expand All @@ -21,27 +19,19 @@ namespace :symfony do
namespace :cache do
desc "Run app/console cache:clear for the #{fetch(:symfony_env)} environment"
task :clear do
on release_roles(fetch(:symfony_deploy_roles)) do
symfony_console "cache:clear"
end
symfony_console "cache:clear"
end

desc "Run app/console cache:warmup for the #{fetch(:symfony_env)} environment"
task :warmup do
on release_roles(fetch(:symfony_deploy_roles)) do
symfony_console "cache:warmup"
end
symfony_console "cache:warmup"
end
end

namespace :assets do
desc "Install assets"
task :install do
on release_roles(fetch(:symfony_deploy_roles)) do
within release_path do
symfony_console "assets:install", fetch(:assets_install_path) + ' ' + fetch(:assets_install_flags)
end
end
symfony_console "assets:install", fetch(:assets_install_path) + ' ' + fetch(:assets_install_flags)
end
end

Expand Down

0 comments on commit 0182ad8

Please sign in to comment.