def pull_origin_master(directory, host=None, port=22):
"""
Pull origin master in a directory on the remote machine
:param str directory: directory on the remote machine to pull origin master in
:param str host: hostname or ip of the remote machine, None for the local machine
:param int port: port to use to connect to the remote machine over ssh
:return int exit_code: exit code of the remote command
"""
log.info("Pulling origin master in {}".format(directory))
pull_origin_master_command = 'cd {}; git pull origin master'.format(
quote(directory)
)
exit_code, _, _ = run_command_print_ready(
pull_origin_master_command, host=host, port=port,
failure_callback=log_failure_factory(
"Failed to pull origin master"
),
buffered=False,
shell=True
)
return exit_code
评论列表
文章目录