I have a webserver cluster with two nodes. They use the same file server to host files from. Since the files are shared, I only need to get to one of the servers to do my deploy, but I would like to clear APC cache on both of them. Is there a way for me to tell Capifony to not deploy to the second server, just run "symfony:clear_apc"?
My deploy.rb as it currently stands:
set :application, "app.domain.net"
set :domain, "#{application}"
set :deploy_to, "/hosting_files/#{application}"
set :app_path, "app"
set :web_path, "web"
set :repository, "git@bitbucket.org:company/#{application}.git"
set :scm, :git
set :deploy_via, :remote_cache
set :model_manager, "doctrine"
role :web, "X.domain.com"
role :app, "X.domain.com"
role :db, "X.domain.com", :primary => true
set :keep_releases, 10
set :shared_files, ["app/config/parameters.yml"]
set :shared_children, [app_path + "/logs", web_path + "/uploads", "vendor"]
set :permission_method, :acl
set :use_composer, true
set :interactive_mode, false
set :branch, `git tag`.split("\n").last
set :user, "applicationUser"
set :use_sudo, false
ssh_options[:forward_agent] = true
ssh_options[:keys] = [File.join(ENV["HOME"], ".ssh", "id_rsa")]
"symfony:cache:warmup"
logger.level = Logger::MAX_LEVEL
namespace :symfony do
desc "Clear apc cache"
task :clear_apc do
capifony_pretty_print "--> Clear apc cache"
run "php #{deploy_to}/current/app/console apc:clear"
capifony_puts_ok
end
end
after "deploy", "symfony:clear_apc"