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

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

我正在使用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 [email protected]:xxx/xxx.git

我有以下错误;

git clone [email protected]:xxx/xxx.git

+ git clone [email protected]: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键Use SSH keys in Bitbucket Pipelines如何调试?

谢谢!

bitbucket bitbucket-pipelines
1个回答
0
投票

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

  1. 您要访问自己的存储库(即管道所属的存储库)

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

  1. 您要访问公开的Bitbucket存储库。

请确保您可以在不设置任何身份验证的情况下从本地终端克隆公共存储库。如果可行,您可以通过管道进行相同的操作,不需要SSH。

  1. 您是否要克隆另一个自己的存储库?

在这种情况下,您需要具有该存储库的正确访问权限。 SSH是执行此操作的好方法。在具有管道的存储库中创建SSH密钥对。在回购设置>管道设置> SSH密钥>生成密钥下。然后使用生成的公钥并将其添加到您要克隆的仓库中。存储库设置>常规>访问键

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