回滚时的Capifony错误

时间:2015-09-23 13:20:21

标签: symfony deployment capistrano rollback capifony

我一直在使用Capifony来部署我的应用程序,一切正常。但是,如果在部署期间出现错误,则会回滚并且回滚失败。

*** [deploy:update_code] rolling back
  * executing "sudo -p 'sudo password: ' rm -rf /var/www/capifony/releases/20150923104657; true"
servers: ["myserver"]
[myserver] executing command
command finished in 110ms
**failed: "sh -c 'sudo -p '\\''sudo password: '\\'' sh -c '\\''cd /var/www/capifony/releases/20150923104657 && SYMFONY_ENV=prod /usr/local/bin/composer.phar install --no-dev --verbose --prefer-dist --optimize-autoloader --no-progress'\\'''" on myserver**

然后浏览器上的错误是:

  

编译错误:Symfony \ Component \ Debug \ DebugClassLoader :: loadClass():无法打开所需' /mnt/app/www/capifony/releases/20150923104657/src/MyApp/CoreBundle/MyAppCoreBundle.php' ; (包含路径=' / MNT /应用/网络/ capifony /共享/供应商/ PHPUnit的/ PHPUnit的-模拟对象:/ MNT /应用/网络/ capifony /共享/供应商/ PHPUnit的/ PHP的文件迭代器:/ MNT /应用/网络/ capifony /共享/供应商/ PHPUnit的/ PHPUnit的:到/ mnt /应用/网络/ capifony /共享/供应商/ symfony的/ YAML::在/ usr /共享/ PHP:在/ usr /共享/梨&#39 ;)

据我所知,它试图在20150923104657版本上安装作曲家。但是,这是它刚刚删除的版本(rm -rf / var / www / capifony / releases / 20150923104657)。它失败了,这是正常的。但是我不明白为什么它会在这个订单上做到这一点。

有人能帮助我吗?

编辑:

我的Capfile:

load 'deploy' if respond_to?(:namespace) # cap2 differentiator

require 'capifony_symfony2'

我的deploy.rb:

设置:应用程序," myapp"

set :deploy_to,                      "/var/www/capifony"
set :app_path,                      "app"
set :repository,                     "https://git-myapp@github.com/Myapp/myapp.git"
set :scm,                              :git
set :branch,                          "master"
set :model_manager,           "doctrine"
set :symfony_env_prod,      "prod"

#recette
role :web,                    "myserver"
role :app,                    "myserver", :primary => true

set :use_sudo,                     true
set :user,                             "ubuntu"
set :keep_releases,             10
set :assets_install,                true
set :dump_assetic_assets,     true
set :use_composer,              true
set :composer_bin,               "/usr/local/bin/composer.phar"
set :update_vendors,            false             # false = install mode
set :clear_controllers,            false
set :shared_files,                  ["app/config/parameters.yml"]
set :shared_children,            [app_path + "/logs", app_path + "/Resources/images/myimages",   web_path + "/media", web_path + "/zip", web_path + "/temp", "vendor"]
set :deploy_via,                    :remote_cache
set :writable_dirs,                 ["app/cache", "app/logs" , "app/../web", "app/Resources/images/myimages"]
set :webserver_user,          "www-data"
set :permission_method,       :chown
set :use_set_permissions,     true

logger.level = Logger::MAX_LEVEL

before "deploy", "maintenance_enable", "cron_stop", "permissions_capifony", "finalize_update"
after "deploy", "deploy:cleanup", "others_tasks", "cron_start"
before "symfony:cache:warmup", "symfony:doctrine:schema:update"

如果有必要,我还可以添加任务的详细信息。

0 个答案:

没有答案