我正在使用fabric来自动部署。
如果我将ssh连接到生产服务器:
freelance@freelance:~$ cd /var/www/freelance/
freelance@freelance:/var/www/freelance$ git pull
Already up-to-date.
freelance@freelance:/var/www/freelance$ git pull
Already up-to-date.
freelance@freelance:/var/www/freelance$ whoami
freelance
git不要问我什么(因为我已经在bitbucket上设置了键)。
但是,如果我使用面料,它可以工作,但他问我密码:
(ve)bepxxx-3411:freelance d$ fab git_pull
[peaidjosparino.cloudapp.net] Executing task 'git_pull'
[peaidjosparino.cloudapp.net] run: git pull
[peaidjosparino.cloudapp.net] Passphrase for private key:
[peaidjosparino.cloudapp.net] Login password for 'freelance':
[peaidjosparino.cloudapp.net] out: Already up-to-date.
[peaidjosparino.cloudapp.net] out:
Done.
Disconnecting from peaidjosparino.cloudapp.net... done.
用户是相同的,服务器是相同的。
有什么想法吗?
更新 还有一个简单的uname -a
(ve)bdxx-3411:freelance d$ fab test_prova
[peaidjosparino.cloudapp.net] Executing task 'test_prova'
[peaidjosparino.cloudapp.net] run: uname -a
[peaidjosparino.cloudapp.net] Passphrase for private key:
[peaidjosparino.cloudapp.net] Login password for 'freelance':
[peaidjosparino.cloudapp.net] out: Linux freelance 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
[peaidjosparino.cloudapp.net] out:
Done.
Disconnecting from peaidjosparino.cloudapp.net... done.
˚F
答案 0 :(得分:2)
尝试使用以下
env.forward_agent = True