无法克隆源代码,因为vsts权限

问题描述 投票:0回答:1

我正在尝试使用vsts将java应用程序部署到容器中

这份工作将:

  • 将ssh连接到docker vm(使用sudo用户,而不是root用户)
  • 从respestory克隆代码(使用管理员帐户)
  • 将代码放入docker vm的文件夹中,
  • 生成一个war文件
  • 将war文件放在tomcat服务器容器下

ssh连接到docker vm步骤后,我的测试作业显示错误:

TF401019: The Git repository with name or identifier [Git Repository] does not exist or you do not have permissions for the operation you are attempting.

进入docker VM,我也不能从vsts克隆项目(显示相同的错误),虽然我生成了一个公钥并将它们放入vsts服务器

任何人都有关于我做错了什么的想法?

当我使用docker vm中的sudo git clone @link to git repo

像这样的错误消息:

Your Git command did not succeed.
Details:
    Public key authentication failed.

fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
git docker azure-devops azure-pipelines
1个回答
0
投票

是的,您正在以正确的方式生成公钥并将其放入vsts服务器(Azure DevOps)似乎Azure DevOps(VSTS)没有您的公共SSH密钥来使用repo。您可以在需要克隆存储库的VM上使用create SSH key pair。请打开Git Bash控制台工具(或只输入终端)并创建SSH密钥下一个命令,并使用Azure DevOps帐户电子邮件:

ssh-keygen -C "[email protected]"

输入更改的命令后,按ENTER键将密钥保存在建议的文件中,然后输入y键以覆盖是否已存在SSH密钥文件。然后控制台将要求设置密码,只需按两次ENTER按钮使其为空。

下一步是读取公共SSH密钥并将其复制到Azure DevOps Security页面。该命令将输出公钥:

cat ~/.ssh/id_rsa.pub 

然后选择并复制到剪贴板您的公钥(没有任何空格)。最后一步是add the public key to Azure DevOps Services。此链接将显示添加位置。完成这些步骤后,您可以再次尝试使用源代码克隆存储库。

© www.soinside.com 2019 - 2024. All rights reserved.