Re: [capistrano] How to deploy from a git repository stored at the same web server?

423 views
Skip to first unread message

Rafa García

unread,
May 9, 2013, 6:57:01 AM5/9/13
to capis...@googlegroups.com
Hi David

  Could you try with this settings?

      set :repository, "file://."
      set :deploy_via, :copy


Regards


2012/11/16 David Morales <ida...@gmail.com>

I have only 1 server, that stores my web site, and my git repository.

When deploying with capistrano, if I configure my repository like this:

set :repository, "ssh://us...@example.com/var/git/myapp.git"

When capistrano connects to the server through SSH, it tries to connect to the server again through SSH, thus asking me for the SSH password:

$ bundle exec cap deploy:update
  * 2012-11-16 13:49:55 executing `deploy:update'
 ** transaction: start
  * 2012-11-16 13:49:55 executing `deploy:update_code'
    updating the cached checkout on all servers
    executing locally: "git ls-remote ssh://us...@example.com/var/git/myapp.git master"
    command finished in 1294ms
  * executing "if .......(omitted)....; fi"
    servers: ["example.com"]
    [example.com] executing command
 ** [example.com :: out] us...@example.com's password:
Password:

Is there any way to instruct Capistrano to look at a local server repository, instead of connecting again through SSH?

I have tried to accomplish it this way:

set :repository, "file:///var/git/#{application}.git"
set :deploy_via, :copy

But then it does not recognize the git repository:

$ bundle exec cap deploy:update
  * 2012-11-16 13:52:59 executing `deploy:update'
 ** transaction: start
  * 2012-11-16 13:52:59 executing `deploy:update_code'
    executing locally: "git ls-remote file:///var/git/myapp.git master"
fatal: '/var/git/myapp.git' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
*** [deploy:update_code] rolling back
  * executing "rm -rf /var/www/myapp/releases/20121116125259; true"
    servers: ["example.com"]
    [example.com] executing command
    command finished in 652ms
Command git ls-remote file:///var/git/myapp.git master returned status code pid 3009 exit 128

Of course the repository works well. In my server I run this:

$ git ls-remote file:///var/git/myapp.git master

... and I get:

kahs8f29bb2ta7agr968129670asfcas8cd82126    refs/heads/master

Note: I have already searched through all similar questions related to this question, but none of them solved my problem.



Ruby version: 1.9.3p327
Capistrano version: 2.13.5

--
* You received this message because you are subscribed to the Google Groups "Capistrano" group.
* To post to this group, send email to capis...@googlegroups.com
* To unsubscribe from this group, send email to capistrano+...@googlegroups.com For more options, visit this group at http://groups.google.com/group/capistrano?hl=en

Rafa García

unread,
May 9, 2013, 6:59:40 AM5/9/13
to capis...@googlegroups.com
If you are using SSH you can solve it using SSH keys. A fast search in google looking for "SSH keys" give you tons of info :)

Regards


2013/5/9 chrisg <chris....@gmail.com>
Were you able to resolve this error?
---
You received this message because you are subscribed to the Google Groups "Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email to capistrano+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages