我使用capifony和symfony 2。
我的 deploy.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为prod尝试清除缓存,但它不能。所以我可以看到某种错误,为什么它无法清除缓存?它清除了dev的缓存,但对于prod,它失败了,没有任何错误。