我想在Capistrano部署后执行Shell命令( cp ): swift
# config valid only for current version of Capistrano
lock '3.5.0'
set :application, 'Dometech.fr'
set :repo_url, 'ssh://git@MYIP:MYPORT/var/www/depotsGit/myproject.git/'
set :deploy_to, '/var/www/dev/Myproject'
set :symfony_directory_structure, 2
set :controllers_to_clear, []
namespace :deploy do
after "deploy:updated" , "composer:install"
# Clear ACL only before switching version
before "deploy:publishing" , "symfony:fixes_acl"
end
namespace :swift do
desc 'Swift config'
task :swift do
on roles(:web) do
execute :cp, '/var/www/a.php /var/www/b.php'
end
end
end
但这个简单的命令从未执行过......你能帮助我吗?
答案 0 :(得分:2)
您已定义任务,但未将其设置为运行。如果你添加这个:
after "deploy", "swift:swift"
应在部署后调用。