在VSTS中使用SSH与BitBucket的其他连接

时间:2018-09-05 22:05:59

标签: ssh azure-devops bitbucket bitbucket-cloud

我一直在尝试为使用BitBucket的项目在VSTS中建立新的版本。原因是我想离开TeamCity。我已经使用OAuth设置了与BitBucket的连接,效果很好。

我的问题是,当我运行npm install任务时,它失败并显示以下消息:

npm ERR! Error while executing:
npm ERR! C:\agents\2.139.1\externals\git\cmd\git.EXE ls-remote -h -t ssh://git@bitbucket.org/{project}/{repo}.git
npm ERR! 
npm ERR! Host key verification failed.
npm ERR! fatal: Could not read from remote repository.
npm ERR! 
npm ERR! Please make sure you have the correct access rights 
npm ERR! and the repository exists.
npm ERR! 
npm ERR! exited with error code: 128

package.json中的一个依赖项指的是通过SSH在BitBucket中的另一个存储库。我似乎找不到找到将SSH密钥添加到构建中以通过BitBucket进行身份验证的方法。我也无法更改package.json文件,因为开发团队和当前TeamCity项目配置当前正在使用它。

有没有一种方法可以将SSH密钥添加到VSTS中的版本中,如果可以,它在哪里?

1 个答案:

答案 0 :(得分:1)

有一个Install SSH Key构建任务,可用于在构建或发布之前安装SSH密钥。