bmi*_*vic 5 git bitbucket fabric
我正在尝试在 fabfile.py 中编写部署脚本。这是我的代码:
from fabric.api import *
env.user = 'user'
env.hosts = ['my_host']
env.dbname = 'foo.bar'
env.dbuser = 'pg_user'
env.dbpass = 'pg_user'
code_dir = '/cygdrive/d/folder'
def deploy():
with cd(code_dir):
run('git pull')
run('pip install -r requirements.txt')
run('manage.py migrate --all')
run('net stop Apache2.2')
run('net start Apache2.2')
Run Code Online (Sandbox Code Playgroud)
当我尝试fab deploy 时,出现错误:
[my_host] Executing task 'deploy'
[my_host] run: git pull
[my_host] out: Host key verification failed.
[my_host] out:
[my_host] out: fatal: Could not read from remote repository.
[my_host] out:
[my_host] out: Please make sure you have the correct access rights
[my_host] out: and the repository exists.
[my_host] out:
Fatal error: run() received nonzero return code 1 while executing!
Run Code Online (Sandbox Code Playgroud)
git pull 命令应该从 bitbucket.org 存储库 (ssh) 中拉取。它被添加到 known_hosts 文件中(之前克隆了 repo)。两台机器都使用Windows。
在远程计算机上从命令行运行 git pull 可以工作,但它不会从 Fabric 部署脚本运行!
有任何想法吗?