我将 capifony 与 symfony 2 一起使用。
我的部署.rb
set :application, "Name project"
set :domain, "My Ip"
set :deploy_to, "My folder"
set :app_path, "app"
set :repository, "git@bitbucket.org:dou/test.git"
set :scm, :git
# Or: `accurev`, `bzr`, `cvs`, `darcs`, `subversion`, `mercurial`, `perforce`, or `none`
set :model_manager, "doctrine"
# Or: `propel`
set :shared_files, ["app/config/parameters.yml"]
set :shared_children, [app_path + "/logs", web_path + "/uploads", web_path + "/media", "vendor"]
set :use_composer, true
#set :composer_options, "--prefer-source --no-interaction"
set :deploy_via, :copy
set :branch, "master"
set :user, 'user'
set :password, 'pass'
role :web, domain # Your HTTP server, Apache/etc
role :app, domain, :primary => true # This may be the same as your `Web` server
set :keep_releases, 3
set :use_sudo, false
set :update_vendors, true
# Be more verbose by uncommenting the following line
logger.level = Logger::MAX_LEVEL
#set :dump_assetic_assets, true
set :ssh_options, { :forward_agent => true }
default_run_options[:pty] = true
一切都很好。但是昨天我有一个错误。
* 2013-12-10 11:51:23 executing `symfony:cache:warmup'
--> Warming up cache
* executing "sh -c 'cd /home/myproject/beta/releases/20131210094811 && php app/console cache:warmup --env=prod --no-debug'"
servers: ["IP"]
[IP] executing command
** [out :: IP] Warming up the cache for the prod environment with debug false
command finished in 18712ms
*** [deploy:update_code] rolling back
* executing "rm -rf /home/myproject/beta/releases/20131210094811; true"
servers: ["IP"]
[IP] executing command
command finished in 633ms
failed: "sh -c 'sh -c '\\''cd /home/myproject/beta/releases/20131210094811 && php app/console cache:warmup --env=prod --no-debug'\\'''" on IP
Capifony 尝试清除产品缓存,但它不能。所以我可以看到某种错误,为什么它不能清除缓存?它清除了开发人员的缓存,但对于产品来说,它失败了,对我来说没有任何错误。