0

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,  "user@xxx.xxx.xxx.xx:/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 user@xx.xx.xx.xx:/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

Antonio Peric
  • 246
  • 1
  • 2
  • 13

1 Answers1

1

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 )

Nicolai Fröhlich
  • 51,330
  • 11
  • 126
  • 130
  • Yes, i did it but now i have 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 Jun 25 '13 at 12:25
  • see my comment on your question. wrong password/publickey ... double-check your credentials! – Nicolai Fröhlich Jun 25 '13 at 12:26
  • Ok, now i have new error :) Command git ls-remote user@xxx.xxx.xxx.xx:/var/www/user/user.git HEAD returned status code 32768 – Antonio Peric Jun 25 '13 at 12:44
  • this is another question, please accept my answer on this one first if it helped you - a solution to your new problem can be found here: http://stackoverflow.com/questions/2293212/capistrano-git-repository-local-to-production-server – Nicolai Fröhlich Jun 25 '13 at 12:47
  • hm... still no:( Type your SSH password for user "xxxxx": [xxx.xxx.xxx.xx] executing command ** [xxx.xxx.xxx.xx :: err] stdin: is not a tty ** [xxx.xxx.xxx.xx :: err] Permission denied, please try again. ** [xxx.xxx.xxx.xx :: err] Permission denied, please try again. ** [xxx.xxx.xxx.xx :: err] Permission denied (publickey,password). ** fatal: The remote end hung up unexpectedly – Antonio Peric Jun 25 '13 at 12:49
  • please accept this answer - open a new question with your new error message and i will help you over there. this way other users can benefit from the solution aswell, okay? :) – Nicolai Fröhlich Jun 25 '13 at 12:51
  • I can accept it but that didn't solve problem I have. stdin: i not a tty is not main problem here :( – Antonio Peric Jun 25 '13 at 12:56
  • And also you need to add: default_run_options[:pty] = true – Antonio Peric Jun 25 '13 at 13:14