【问题标题】:How to use a private repository in CircleCI?如何在 CircleCI 中使用私有存储库?
【发布时间】:2021-04-30 03:28:13
【问题描述】:

我是 Redmine 插件的测试人员。我想测试所有插件。

为了做到这一点,我在一个插件的存储库(由 Github 管理)下设置了 .circleci/config.yml 并尝试测试。但我收到以下错误消息。

    #!/bin/bash -eo pipefail
    git clone https://github.com/xxxxxx/lad.git
    Cloning into 'lad'...
    ERROR: Repository not found.
    fatal: Could not read from remote repository.

    Please make sure you have the correct access rights
    and the repository exists.
    Exited with code 128

我想了解获取与我现在使用的存储库不同的私有存储库克隆的方法。

以下是我现在的.circleci/config.yml

version: 2

jobs:
  build:
    docker:
      - image: ruby:2.3.0
        environment:
      - LANG: C.UTF-8
    environment:
      BUNDLE_GEMFILE: /root/project/.circleci/Gemfile
    steps:
      - checkout
      - run: git clone --depth=1 --branch=${REDMINE_VERSION:-3.4-stable} https://github.com/redmine/redmine.git
      # this is private repository ↓
      - run: git clone https://github.com/xxxxxx/lad.git
      - run:
          name: Check status
          command: |
            pwd
            ls -al

【问题讨论】:

  • 我在访问项目中的私有存储库时遇到了同样的问题。你找到解决办法了吗?

标签: github ssh circleci


【解决方案1】:

您需要向 CircleCI 添加一个私有 SSH 密钥,该密钥可以访问您尝试克隆的 GitHub 存储库。这将通过项目设置页面中的 CircleCI webapp 完成。更多信息在这里:https://circleci.com/docs/2.0/gh-bb-integration/#enable-your-project-to-check-out-additional-private-repositories

【讨论】:

    猜你喜欢
    • 2021-11-15
    • 2022-07-21
    • 2017-12-21
    • 1970-01-01
    • 1970-01-01
    • 2015-06-24
    • 2018-01-14
    • 2019-05-03
    • 2016-05-10
    相关资源
    最近更新 更多