git - Capistrano unable to pull a Stash repository using SSH -
i followed following procedure:
- created ssh key;
- enabled ssh in atlassian stash;
- added ssh key stash account called capistrano (already used capistrano connect using username , password stash)
- tested ssh connection using command
git clone ssh://git@stash.domain.com:7999/project/repository.git
, repository cloned; - changed following line
config/deploy.rb
in capistrano project directory:set :repo_url, 'ssh://git@stash.domain.com:7999/project/repository.git'
the problem executing command cap production git:check
following error lines , deployment cancelled:
info [8b21e06e] running /usr/bin/env mkdir -p /tmp/capistrano_project_name/ deploy@host.domain.com debug [8b21e06e] command: /usr/bin/env mkdir -p /tmp/capistrano_project_name/ info [8b21e06e] finished in 0.292 seconds exit status 0 (successful). debug uploading /tmp/capistrano_project_name/git-ssh.sh 0.0% info uploading /tmp/capistrano_project_name/git-ssh.sh 100.0% info [376577ce] running /usr/bin/env chmod +x /tmp/capistrano_project_name/git-ssh.sh deploy@host.domain.com debug [376577ce] command: /usr/bin/env chmod +x /tmp/capistrano_project_name/git-ssh.sh info [376577ce] finished in 0.036 seconds exit status 0 (successful). info [2ed5c706] running /usr/bin/env git ls-remote --heads ssh://git@stash.domain.com:7999/project/repository.git deploy@host.domain.com debug [2ed5c706] command: ( git_askpass=/bin/echo git_ssh=/tmp/capistrano_project_name/git-ssh.sh /usr/bin/env git ls-remote --heads ssh://git@stash.domain.com:7999/project/repository.git ) debug [2ed5c706] permission denied (publickey). debug [2ed5c706] fatal: not read remote repository. debug [2ed5c706] debug [2ed5c706] please make sure have correct access rights debug [2ed5c706] , repository exists. (backtrace restricted imported tasks) cap aborted! exception while executing deploy@host.domain.com: git exit status: 128 git stdout: nothing written git stderr: permission denied (publickey). fatal: not read remote repository. please make sure have correct access rights , repository exists. tasks: top => git:check (see full trace running task --trace)
i tried change variable set :repo_url, 'ssh://git@stash.domain.com:7999/project/repository.git'
receive same error. connecting capistrano stash via ssh? please suggest how can debug it? avoid use usernames , passwords in capistrano configuration files.
a simplistic answer, guess capistrano picking wrong key. i'd suggest check default ssh key deployment user. so, if capistrano set log server using deployuser
, see key deployuser
picks up. can helpful test ssh -t git@stash.domain.com -p 7999
, see comes back.
Comments
Post a Comment