我正在尝试访问git2consul的私有git repo(bitbucket)。领事代理和git2consul都在运行。 在git2consul上,我在
上创建一个配置文件/tmp/git2consul.json
{
"version": "1.0",
"repos" : [{
"name" : "sample_configuration",
"url" : "ssh://git@bitbucket.org/mycompadmin/mycomp-platform.git",
"branches" : ["develop"],
"hooks": [{
"type" : "polling",
"interval" : "1"
}]
}]
}
我正在通过命令执行此操作:
sudo git2consul --config-file /tmp/git2consul.json
但出现权限问题:
"Failed to create repos due to Failed to load repo sample_configuration due to Error: Error: Command failed: git clone -b develop ssh://git@bitbucket.org/mycompadmin/mycomp-platform.git develop\nCloning into 'develop'...\ngit@bitbucket.org: Permission denied (publickey).\r\nfatal: Could not read from remote repository.\n\nPlease make sure you have the correct access rights\nand the repository exists.\n Cloning into 'develop'...\ngit@bitbucket.org: Permission denied (publickey).\r\nfatal: Could not read from remote repository.\n\nPlease make sure you have the correct access rights\nand the repository exists.","time":"2019-02-20T10:40:43.553Z","v":0}
由于我能够通过另一个应用程序(spring cloud config server)从git中读取文件,这意味着/home/.ssh文件夹中的键可以正常工作。
请提出建议。我遵循了该教程:https://github.com/breser/git2consul#configuration-format