Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/symfony/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Capifony和git裸回购_Git_Symfony_Capifony - Fatal编程技术网

Capifony和git裸回购

Capifony和git裸回购,git,symfony,capifony,Git,Symfony,Capifony,我有这个deploy.rb文件: set :application, "UDA" set :domain, "10.0.0.59" set :deploy_to, "/home/gitek/www/uda/" set :app_path, "app" set :user, "gitek" ssh_options[:port] = 22 set :php_bin, "/usr/bin/php" set :scm, :git #set :gi

我有这个deploy.rb文件:

set :application, "UDA"
set :domain,      "10.0.0.59"
set :deploy_to,   "/home/gitek/www/uda/"
set :app_path,    "app"

set :user,        "gitek"

ssh_options[:port] = 22
set :php_bin, "/usr/bin/php"

set :scm,         :git
#set  :git_enable_submodules,  1
set  :repository,             "#{domain}:/var/repos/uda.git"
set  :deploy_via,             :remote_cache

# Or: `accurev`, `bzr`, `cvs`, `darcs`, `subversion`, `mercurial`, `perforce`, `subversion` or `none`

set :model_manager, "doctrine"
# Or: `propel`
role :web,        domain                         # Your HTTP server, Apache/etc
role :app,        domain                         # This may be the same as your `Web` server
role :db,         domain, :primary => true       # This is where Rails migrations will run

set  :keep_releases,  5
set :use_sudo,    false

set :update_vendors, true
ssh_options[:forward_agent] = true


set :shared_files,      ["app/config/parameters.ini"]
set :shared_children,     [app_path + "/logs", web_path + "/uploads", "vendor"]
我的repo是裸repo,它位于同一个服务器中,位于/var/repos/

事实上,我在执行cap deploy命令时遇到了这个错误:

gitek@/Applications/MAMP/htdocs/uda$ cap deploy
  * executing `deploy'
  * executing `deploy:update'
 ** transaction: start
  * executing `deploy:update_code'
    updating the cached checkout on all servers
    executing locally: "git ls-remote 10.0.0.59:/var/repos/uda.git HEAD"
    command finished in 5487ms
  * executing "if [ -d /home/gitek/www/uda/shared/cached-copy ]; then cd /home/gitek/www/uda/shared/cached-copy && git fetch -q origin && git fetch --tags -q origin && git reset -q --hard 051be2de2155dfac7cfb45df0b4c2fb6ca633555 && git clean -q -d -x -f; else git clone -q 10.0.0.59:/var/repos/uda.git /home/gitek/www/uda/shared/cached-copy && cd /home/gitek/www/uda/shared/cached-copy && git checkout -q -b deploy 051be2de2155dfac7cfb45df0b4c2fb6ca633555; fi"
    servers: ["10.0.0.59"]
    [10.0.0.59] executing command
 ** [10.0.0.59 :: err] Permission denied, please try again.
 ** [10.0.0.59 :: err] Permission denied, please try again.
 ** [10.0.0.59 :: err] Permission denied (publickey,password).
 ** [10.0.0.59 :: err] fatal: The remote end hung up unexpectedly
    command finished in 754ms
*** [deploy:update_code] rolling back
  * executing "rm -rf /home/gitek/www/uda/releases/20111013112554; true"
    servers: ["10.0.0.59"]
    [10.0.0.59] executing command
    command finished in 20ms
failed: "sh -c 'if [ -d /home/gitek/www/uda/shared/cached-copy ]; then cd /home/gitek/www/uda/shared/cached-copy && git fetch -q origin && git fetch --tags -q origin && git reset -q --hard 051be2de2155dfac7cfb45df0b4c2fb6ca633555 && git clean -q -d -x -f; else git clone -q 10.0.0.59:/var/repos/uda.git /home/gitek/www/uda/shared/cached-copy && cd /home/gitek/www/uda/shared/cached-copy && git checkout -q -b deploy 051be2de2155dfac7cfb45df0b4c2fb6ca633555; fi'" on 10.0.0.59
gitek@/Applications/MAMP/htdocs/uda$ 
我认为问题的出现是因为我的git回购是一个赤裸裸的

有人知道如何解决这个问题吗


提前感谢

问题是您试图使用网络访问服务器,但由于缺少SSH密钥,git无法进行身份验证

如果服务器位于同一台部署计算机上,则使用远程连接进行克隆是没有意义的。通过传递存储库路径克隆本地存储库

set  :repository,  "/var/repos/uda.git"

更改deploy.rb并将存储库设置为:

集合:存储库,ssh://USER@SERVERIP/var/repos/uda.git

不要忘记添加到服务器10.0.0.59上的自动设置的密钥2

cat.ssh/id_rsa.pub|sshUSER@SERVERcat>.ssh/authorized_密钥2


希望能有帮助。它对我有效。

它不起作用,它说:致命:“/var/repos/uda.git”似乎不是git repository路径是否有效?cd到/var/repos/uda.git并执行git status以确保它是有效的repository.ups!我得到这个错误:gitek@ubuntu:/var/repos/uda.git$git status fatal:此操作必须在有效存储库的工作树中运行。我忘了git状态在基本存储库中不起作用。对不起,我不知道克隆失败的原因。我应该检查完整的日志。我在哪里可以得到完整的日志?