3

cap staging git:checkが capistrano インストール手順に従った後に失敗 する -A オプションを指定した ssh は正常に動作しますが、git:check を使用していません。

http://capistranorb.com/documentation/getting-started/cold-start/

$ cap staging git:check
DL is deprecated, please use Fiddle
 INFO [f06698cd] Running /usr/bin/env mkdir -p /tmp/my_project/ on my_domain.com
DEBUG [f06698cd] Command: /usr/bin/env mkdir -p /tmp/my_project/
 INFO [f06698cd] Finished in 0.976 seconds with exit status 0 (successful).
DEBUG Uploading /tmp/my_project/git-ssh.sh 0.0%
 INFO Uploading /tmp/my_project/git-ssh.sh 100.0%
 INFO [296a196a] Running /usr/bin/env chmod +x /tmp/my_project/git-ssh.sh on my_domain.com
DEBUG [296a196a] Command: /usr/bin/env chmod +x /tmp/my_project/git-ssh.sh
 INFO [296a196a] Finished in 0.181 seconds with exit status 0 (successful).
DEBUG [063672c2] Running /usr/bin/env git ls-remote ssh://git@git-domain.com:8889/my_project/my_project.git on my_domain.com
DEBUG [063672c2] Command: ( GIT_ASKPASS=/bin/echo GIT_SSH=/tmp/my_project/git-ssh.sh /usr/bin/env git ls-remote ssh://git@git-domain.com:8889/my_project/my_project.git )
DEBUG [063672c2]        Error reading response length from authentication socket.
DEBUG [063672c2]        Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
DEBUG [063672c2]        fatal: Could not read from remote repository.
DEBUG [063672c2]
DEBUG [063672c2]        Please make sure you have the correct access rights
DEBUG [063672c2]        and the repository exists.
DEBUG [063672c2] Finished in 0.572 seconds with exit status 128 (failed).

環境: Rails 4.0.2 および Ruby 2.0.0p353 を使用する Capistrano 3.1

上限ステージング転送の結果:

$ cap staging forwarding
DL is deprecated, please use Fiddle
DEBUG [92ef7d99] Running /usr/bin/env env | grep SSH_AUTH_SOCK on my_domain.com
DEBUG [92ef7d99] Command: env | grep SSH_AUTH_SOCK
DEBUG [92ef7d99]        SSH_AUTH_SOCK=/tmp/ssh-RWvvKUq627/agent.627
DEBUG [92ef7d99] Finished in 1.843 seconds with exit status 0 (successful).
 INFO Agent forwarding is up to my_domain.com

そして、私は要求された操作を手動で行うことができます...

$ ssh -p 8888 -A deploy@my_domain.com 'git ls-remote ssh://git@git-domain.com:8889/my_project/my_project.git'
0056e931836c18a22055d370deb3967aefb1f4fb        HEAD
0056e931836c18a22055d370deb3967aefb1f4fb        refs/heads/master

私の最善の推測は、何らかの理由で ssh -A オプションを使用していないということです?? お時間をいただきありがとうございます。展開にカピストラーノを使用したいので、これを解決できることを願っています!

deploy.rb 設定:

lock '3.1.0'
set :application, 'my_project'
set :repo_url, 'ssh://git@git-domain.com:8889/my_project/my_project.git'
set :ssh_options, {
  forward_agent: true,
  port: 8888
}
set :use_sudo, false # tried with and without this setting
set :branch, 'master'

staging.rbの設定

role :app, %w{deploy@my_domain.com}
role :web, %w{deploy@my_domain.com}
role :db,  %w{deploy@my_domain.com}
server 'my_domain.com', user: 'deploy', roles: %w{web app db}, deploy_to: '/home/deploy/my_project_staging'
4

1 に答える 1

1

経由で ssh アクセスを制限していません/etc/ssh/sshd_configか?

私は同様の問題を抱えていました.git:checkは次のように失敗しました:

DEBUG [0e6f1fac] Permission denied (publickey). DEBUG [0e6f1fac] fatal: Could not read from remote repository.

git:check は git-ssh.sh を /tmp/project_name にアップロードし、サーバーで次のコマンドを実行することが判明しました: git ls-remote -h git@domain.com:/opt/git/project_name (このページで述べたように: http://capistranorb.com/documentation/getting-started/cold-開始/ )

私の場合、git リポジトリと展開サーバーは同じサーバー上にあり、ssh 接続は私の IP からのみ許可されていたので、追加AllowUsers git@localhostしたところ/etc/ssh/sshd_config、役に立ちました。

于 2014-05-31T13:05:45.903 に答える