我正在尝试通过gitlab将我的本地Windows计算机上的部署设置到我的服务器,使用capifony。
通常我会通过ssh连接到我的服务器并从服务器运行命令 现在我想从我的本地计算机上执行它。
我已经用git从我的本地计算机将代码推送到gitlab,即我的公共密钥已经在gitlab上注册了。
但是,在这里,使用capifony却不能正常工作。 可能出了什么问题?
错误信息:
通常我会通过ssh连接到我的服务器并从服务器运行命令 现在我想从我的本地计算机上执行它。
我已经用git从我的本地计算机将代码推送到gitlab,即我的公共密钥已经在gitlab上注册了。
但是,在这里,使用capifony却不能正常工作。 可能出了什么问题?
错误信息:
D:\Divers\Programmation\Web\foodmeup.dev>cap development deploy
** transaction: start
--> Updating code base with remote_cache strategy
*** [deploy:update_code] rolling back
** [deploy:update_code] exception while rolling back: Capistrano::ConnectionError, connection failed for: my_server_ip (ArgumentError: Could not parse PKey: no start line)
connection failed for: my_server_ip (ArgumentError: Could not parse PKey: no start line)
编辑:
如果我按照几篇帖子中给出的指示,在我的deploy.rb文件中添加以下选项:
ssh_options[:keys] = %w('~/.ssh/id_rsa')
或者
ssh_options[:keys] = %w('~/.ssh/id_rsa.pub')
然后我被要求输入root密码,但是我仍然遇到了错误(尽管我可以直接使用Putty通过ssh登录,并且在使用另一个用户从我的服务器运行部署时无需输入root密码):
D:\Divers\Programmation\Web\foodmeup.dev>cap preprod deploy
** transaction: start
--> Updating code base with remote_cache strategy
root@my_server_ip's password:
** [my_server_ip :: err] Error reading response length from authentication socket.
** [my_server_ip :: err] Permission denied (publickey).
** [my_server_ip :: err] fatal: Could not read from remote repository.
**
** Please make sure you have the correct access rights
** and the repository exists.
*** [deploy:update_code] rolling back
failed: "sh -c 'if [ -d /home/foodmeup.net/preprod/shared/cached-copy ]; then cd /home/foodmeup.net/preprod/shared/cached-copy && git fetch -q origin && git fetch --tags -q origin && git reset -q --ha
rd f52737bb09edbd968319400e2d535f467c42b04c && git clean -q -d -x -f; else git clone -q -b preprod git@gitlab.com:svassaux/foodmeup.git /home/foodmeup.net/preprod/shared/cached-copy && cd /home/foodme
up.net/preprod/shared/cached-copy && git checkout -q -b deploy f52737bb09edbd968319400e2d535f467c42b04c; fi'" on my_server_ip