gpt4 book ai didi

Bitbucket 管道 - 无法从远程存储库中读取?

转载 作者:行者123 更新时间:2023-12-04 10:31:57 27 4
gpt4 key购买 nike

我正在使用 bitbucket 管道进行培训

这是我的 bitbucket-pipelines.yml:

image: php:7.2.9

pipelines:
default:
- step:
caches:
- composer
script:
- apt-get update && apt-get install -y unzip zlib1g-dev git curl libmcrypt-dev mysql-client ssh
- docker-php-ext-install bcmath pdo_mysql sockets
- git clone git@bitbucket.org:xxx/xxx.git

我有以下错误;
git clone git@bitbucket.org:xxx/xxx.git

+ git clone git@bitbucket.org:xxx/xxx.git
Cloning into 'lib-purge'...
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

我不明白如何处理我的 ssh key Use SSH keys in Bitbucket Pipelines
如何调试?

谢谢 !

最佳答案

我不是 100% 确定你想要做什么。根据您要实现的目标,请参阅以下三个选项:

  • 您想访问自己的存储库(即您的管道所属的存储库)

  • 在这种情况下,您不需要做任何特别的事情,也不需要设置 ssh。您的管道自动有权访问它所属的存储库。它还会自动为您克隆,因此您无需再这样做。对于针对您自己的 repo 的其他 git 操作,请查看此处: https://community.atlassian.com/t5/Bitbucket-Pipelines-articles/Pushing-back-to-your-repository/ba-p/958407
  • 您想要访问公共(public) Bitbucket 存储库。

  • 确保您可以从本地终端克隆公共(public)存储库,而无需设置任何身份验证。如果可行,您可以从 Pipelines 执行相同操作,无需 SSH。
  • 您是否正在尝试克隆另一个您自己的存储库?

  • 在这种情况下,您需要对该存储库具有正确的访问权限。 SSH 是一个很好的方法。
    在具有管道的存储库中创建一个 SSH key 对。在 repo 设置 > 管道设置 > SSH key > 生成 key 下。然后获取生成的公钥并将其添加到您尝试克隆的存储库中。 repo 设置>常规>访问键

    关于Bitbucket 管道 - 无法从远程存储库中读取?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60380797/

    27 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com