0
votes

i have problem with deploying symfony2 app to my server with capifony. I tried to pull with git directly to my server and that works.

here is my deploy.rb file

# Sylius default deployment configuration.

# Capifony documentation: http://capifony.org
# Capistrano documentation: https://github.com/capistrano/capistrano/wiki

# Be more verbose by uncommenting the following line
# logger.level = Logger::MAX_LEVEL

set :application, "myapp"
set :domain,      "xx.xx.xx.xx"
set :deploy_to,   "/home/user"
set :user,        "user"

role :web,        domain
role :app,        domain
role :db,         domain, :primary => true

set :scm,         :git
set :repository,  "[email protected]:/var/www/user/user.git"
set :branch,      "master"
set :deploy_via,  :remote_cache

ssh_options[:forward_agent] = true

set :use_composer,   true
set :update_vendors, true

set :dump_assetic_assets, true

set :writable_dirs,     ["app/cache", "app/logs"]
set :webserver_user,    "www-data"
set :permission_method, :acl

set :shared_files,    ["app/config/parameters.yml", "web/.htaccess", "web/robots.txt"]
set :shared_children, ["app/logs"]

set :model_manager, "doctrine"

set :use_sudo,    false

set :keep_releases, 3


before 'symfony:composer:update', 'symfony:copy_vendors'

namespace :symfony do
  desc "Copy vendors from previous release"
  task :copy_vendors, :except => { :no_release => true } do
    if Capistrano::CLI.ui.agree("Do you want to copy last release vendor dir then do composer install ?: (y/N)")
      capifony_pretty_print "--> Copying vendors from previous release"

      run "cp -a #{previous_release}/vendor #{latest_release}/"
      capifony_puts_ok
    end
  end
end

after "deploy:update", "deploy:cleanup"
after "deploy", "deploy:set_permissions"

and here is my error

failed: "sh -c 'if [ -d /home/user/shared/cached-copy ]; then cd /home/user/shared/cached-copy && git fetch -q origin && git fetch --tags -q origin && git reset -q --hard f90495dc7d5c62d1bc61415b5c10b762a7e96ee6 && git clean -q -d -x -f; else git clone -q -b master [email protected]:/var/www/user/user.git /home/user/shared/cached-copy && cd /home/user/shared/cached-copy && git checkout -q -b deploy f90495dc7d5c62d1bc61415b5c10b762a7e96ee6; fi'" on xxx.xxx.xxx.xxx

I also tried to run this on my server directly through ssh and that works well.

Any idea? thnx

1
turn on verbose errors and provide a more detailed error message. ... sh , user-rights, git fetch, git reset, git clean, git clone, git checkout ... all possible causes - Nicolai Fröhlich
now i got this: ** [xxx.xx.xx.xx :: err] Permission denied, please try again. ** [xxx.xx.xx.xx:: err] Permission denied, please try again. ** [xxx.xx.xx.xx:: err] Permission denied (publickey,password). ** [xxx.xx.xx.xx :: err] fatal: The remote end hung up unexpectedly - Antonio Peric
you either have a wrong password or public key ... that's why your deployment fails. - Nicolai Fröhlich
Password is same as for SSH login. I dont have any problem with login via ssh on my server :( - Antonio Peric
is the error thrown for the server you're trying to deploy to or your git repository ? - Nicolai Fröhlich

1 Answers

1
votes

You don't seem to have set your SSH password. Either put the setting in your deploy.rb (not recommended) or let capifony ask you for it:

#set :password,    "password"             # the ssh password 
set(:password){ Capistrano::CLI.password_prompt("Type your SSH password for user \"#{user}\": ") }

It's easier to find what's causing your deployment to fail if you increase the log verbosity level using the logger.level setting in your deploy.rb.

# IMPORTANT = 0
# INFO      = 1
# DEBUG     = 2
# TRACE     = 3
# MAX_LEVEL = 3
logger.level = Logger::MAX_LEVEL

( documentation )