I'm trying to use fabric to deploy a Django project and I get this error when I run hg pull
:
[myusername.webfactional.com] run: hg pull
[myusername.webfactional.com] out: remote: Warning: Permanently added the RSA host key for IP address '207.223.240.181' to the list of known hosts.
[myusername.webfactional.com] out: remote: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
[myusername.webfactional.com] err: abort: no suitable response from remote hg!
Fatal error: run() encountered an error (return code 255) while executing 'hg pull'
I can run other mercurial commands like hg status
, and hg log
just fine from my fab file.
I have generated an SSH key on the server and added it to my bitbucket account. This works as I can SSH in and run hg pull
and it works fine, it's only when using fabric.
This is my fabfile:
from __future__ import with_statement
from fabric.api import *
env.hosts = ['myusername.webfactional.com']
env.user = "myusername"
def development():
# Update files
local("hg push")
with cd("~/webapps/mysite/mysite"):
run("hg pull")
# Update database
with cd("~/webapps/mysite/mysite"):
run("python2.6 manage.py syncdb")
run("python2.6 manage.py migrate")
# Reload apache
run("~/webapps/mysite/apache2/bin/restart")
Any ideas?
EDIT:
Got this working using https
so instead of
hg pull
I'm using
hg pull https://[email protected]/myusername/mysite