1

My Capifony setup works... I can deploy multiple versions...

C:\xampp\htdocs\example>cap deploy
--> Updating code base with remote_cache strategy
--> Creating cache directory................................
--> Creating symlinks for shared directories................
--> Creating symlinks for shared files......................
--> Normalizing asset timestamps............................
--> Downloading Composer....................................
--> Installing Composer dependencies........................
--> Dumping all assets to the filesystem....................
--> Warming up cache........................................
--> Clear controllers.......................................
--> Successfully deployed!

The problem is the cap deploy:rollback function.

I got this error:

C:\xampp\htdocs\example>cap deploy:rollback
failed: "sh -c 'cd /srv/www/example && false dump-autoload --optimize'" on 192.168.178.102

Thats the Capfile

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

require 'capifony_symfony2'
load 'app/config/deploy'

Thats the deploy.rb

set   :application,   "ExampleProject"
set   :deploy_to,     "/srv/www/example"
set   :domain,        "example.org"

set   :scm,           :git
set   :repository,    "git@gitlab.example.org:www/project.git"

server "192.168.178.102", :app, :web, :db, :primary => true

set   :use_sudo,      false
set   :keep_releases, 3
set   :deploy_via,    :remote_cache

# Symfony2
set :shared_files,        ["app/config/parameters.yml"]
set :shared_children,     [app_path + "/logs", web_path + "/uploads", "vendor"]
set :use_composer, true
set :dump_assetic_assets, true

# SSH
set :user, "www-data"
set :git_enable_submodules, 1
PatrickB
  • 3,225
  • 5
  • 31
  • 55

3 Answers3

1
  1. Verify that composer is installed or install it manually. Provide path to it in deploy.rb like set :composer_bin, "/usr/bin/composer"
  2. Enable more verbose output by adding logger.level = Logger::DEBUG to get more details.
Anton Babenko
  • 6,586
  • 2
  • 36
  • 44
  • Why "--> Installing Composer dependencies" (vendor installation) works and the rollback doesnt?? I'll test your tips later. – PatrickB Apr 17 '14 at 12:56
  • 1
    Maybe it doesn't work properly (wrong permission, wrong destination, etc), so enabling logging should reveal it. – Anton Babenko Apr 19 '14 at 19:54
0

I was having the same problem you were having. After investigating a bit I found out that path to composer was being set up for some reason. I added the path of composer in my deploy.rb and it worked. So add the following to your deploy.rb

set :composer_bin, "/usr/bin/composer"
hjelpmig
  • 1,406
  • 6
  • 19
  • 23
-1

The rollback task doesn't work/dumps an error using capifony 2.5 onwards, issue open: https://github.com/everzet/capifony/issues/511