Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion How to deploy from a git repository stored at the same web server?

Received: by 10.182.123.104 with SMTP id lz8mr597343obb.45.1353077817366;
        Fri, 16 Nov 2012 06:56:57 -0800 (PST)
X-BeenThere: capistrano@googlegroups.com
Received: by 10.182.169.10 with SMTP id aa10ls427952obc.76.gmail; Fri, 16 Nov
 2012 06:56:47 -0800 (PST)
Received: by 10.224.105.205 with SMTP id u13mr3140819qao.6.1353077807965;
        Fri, 16 Nov 2012 06:56:47 -0800 (PST)
Received: by 10.224.16.202 with SMTP id p10msqaa;
        Fri, 16 Nov 2012 05:02:06 -0800 (PST)
Received: by 10.49.73.228 with SMTP id o4mr880294qev.31.1353070926724;
        Fri, 16 Nov 2012 05:02:06 -0800 (PST)
Date: Fri, 16 Nov 2012 05:02:06 -0800 (PST)
From: David Morales <idav...@gmail.com>
To: capistrano@googlegroups.com
Message-Id: <df18c62f-2948-4431-9171-6ce9f6b93234@googlegroups.com>
Subject: How to deploy from a git repository stored at the same web server?
MIME-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_212_23753217.1353070926181"

------=_Part_212_23753217.1353070926181
Content-Type: multipart/alternative; 
	boundary="----=_Part_213_23254981.1353070926181"

------=_Part_213_23254981.1353070926181
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit



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://u...@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://u...@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] u...@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

------=_Part_213_23254981.1353070926181
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

<div><p style=3D"font-size: 14px; clear: both; word-wrap: break-word; color=
: rgb(0, 0, 0); font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-=
serif; text-align: left; ">I have only 1 server, that stores my web site, a=
nd my git repository.</p><p style=3D"font-size: 14px; clear: both; word-wra=
p: break-word; color: rgb(0, 0, 0); font-family: Arial, 'Liberation Sans', =
'DejaVu Sans', sans-serif; text-align: left; ">When deploying with capistra=
no, if I configure my repository like this:</p><pre style=3D"margin-bottom:=
 10px; padding: 5px; font-size: 14px; background-color: rgb(238, 238, 238);=
 font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono',=
 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, =
serif; overflow: auto; width: auto; max-height: 600px; color: rgb(0, 0, 0);=
 line-height: 18px; text-align: left; "><code style=3D"font-family: Consola=
s, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', =
'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; ">set :reposit=
ory, "ssh://u...@example.com/var/git/myapp.git"
</code></pre><p style=3D"font-size: 14px; clear: both; word-wrap: break-wor=
d; color: rgb(0, 0, 0); font-family: Arial, 'Liberation Sans', 'DejaVu Sans=
', sans-serif; text-align: left; ">When capistrano connects to the server t=
hrough SSH, it tries to connect to the server again through SSH, thus askin=
g me for the SSH password:</p><pre style=3D"margin-bottom: 10px; padding: 5=
px; font-size: 14px; background-color: rgb(238, 238, 238); font-family: Con=
solas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mon=
o', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; overflow: =
auto; width: auto; max-height: 600px; color: rgb(0, 0, 0); line-height: 18p=
x; text-align: left; "><code style=3D"font-family: Consolas, Menlo, Monaco,=
 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera S=
ans Mono', 'Courier New', monospace, serif; ">$ bundle exec cap deploy:upda=
te
  * 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://u...@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] u...@example.com's password:
Password:
</code></pre><p style=3D"font-size: 14px; clear: both; word-wrap: break-wor=
d; color: rgb(0, 0, 0); font-family: Arial, 'Liberation Sans', 'DejaVu Sans=
', sans-serif; text-align: left; ">Is there any way to instruct Capistrano =
to look at a local server repository, instead of connecting again through S=
SH?</p><p style=3D"font-size: 14px; clear: both; word-wrap: break-word; col=
or: rgb(0, 0, 0); font-family: Arial, 'Liberation Sans', 'DejaVu Sans', san=
s-serif; text-align: left; ">I have tried to accomplish it this way:</p><pr=
e style=3D"margin-bottom: 10px; padding: 5px; font-size: 14px; background-c=
olor: rgb(238, 238, 238); font-family: Consolas, Menlo, Monaco, 'Lucida Con=
sole', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', '=
Courier New', monospace, serif; overflow: auto; width: auto; max-height: 60=
0px; color: rgb(0, 0, 0); line-height: 18px; text-align: left; "><code styl=
e=3D"font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mo=
no', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospa=
ce, serif; ">set :repository, "file:///var/git/#{application}.git"
set :deploy_via, :copy
</code></pre><p style=3D"font-size: 14px; clear: both; word-wrap: break-wor=
d; color: rgb(0, 0, 0); font-family: Arial, 'Liberation Sans', 'DejaVu Sans=
', sans-serif; text-align: left; ">But then it does not recognize the git r=
epository:</p><pre style=3D"margin-bottom: 10px; padding: 5px; font-size: 1=
4px; background-color: rgb(238, 238, 238); font-family: Consolas, Menlo, Mo=
naco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream V=
era Sans Mono', 'Courier New', monospace, serif; overflow: auto; width: aut=
o; max-height: 600px; color: rgb(0, 0, 0); line-height: 18px; text-align: l=
eft; "><code style=3D"font-family: Consolas, Menlo, Monaco, 'Lucida Console=
', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Cour=
ier New', monospace, serif; ">$ 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
</code></pre><p style=3D"font-size: 14px; clear: both; word-wrap: break-wor=
d; color: rgb(0, 0, 0); font-family: Arial, 'Liberation Sans', 'DejaVu Sans=
', sans-serif; text-align: left; ">Of course the repository works well. In =
my server I run this:</p><pre style=3D"margin-bottom: 10px; padding: 5px; f=
ont-size: 14px; background-color: rgb(238, 238, 238); font-family: Consolas=
, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', '=
Bitstream Vera Sans Mono', 'Courier New', monospace, serif; overflow: auto;=
 width: auto; max-height: 600px; color: rgb(0, 0, 0); line-height: 18px; te=
xt-align: left; "><code style=3D"font-family: Consolas, Menlo, Monaco, 'Luc=
ida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans M=
ono', 'Courier New', monospace, serif; ">$ git ls-remote file:///var/git/my=
app.git master
</code></pre><p style=3D"font-size: 14px; clear: both; word-wrap: break-wor=
d; color: rgb(0, 0, 0); font-family: Arial, 'Liberation Sans', 'DejaVu Sans=
', sans-serif; text-align: left; ">... and I get:</p><pre style=3D"margin-b=
ottom: 10px; padding: 5px; font-size: 14px; background-color: rgb(238, 238,=
 238); font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation =
Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monos=
pace, serif; overflow: auto; width: auto; max-height: 600px; color: rgb(0, =
0, 0); line-height: 18px; text-align: left; "><code style=3D"font-family: C=
onsolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans M=
ono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; ">kahs8f=
29bb2ta7agr968129670asfcas8cd82126    refs/heads/master
</code></pre><p style=3D"font-size: 14px; clear: both; word-wrap: break-wor=
d; color: rgb(0, 0, 0); font-family: Arial, 'Liberation Sans', 'DejaVu Sans=
', sans-serif; text-align: left; "><strong style=3D"background-color: trans=
parent; ">Note:</strong>&nbsp;I have already searched through all similar q=
uestions related to this question, but none of them solved my problem.</p><=
/div><div><span style=3D"line-height: 17px;"><br></span></div><div><span st=
yle=3D"line-height: 17px;"><br></span></div><div><span style=3D"line-height=
: 17px;">Ruby version: 1.9.3p327</span></div><div><span style=3D"line-heigh=
t: 17px;">Capistrano version: 2.13.5</span></div>
------=_Part_213_23254981.1353070926181--

------=_Part_212_23753217.1353070926181--