在bitbucket管道中使用git子模块更新--init

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

我已经搜索了许多其他相关帖子,但尚未找到解决方案。我有自己的私人laradock存储库,正在将其用作git存储库中的子模块。我有以下bitbucket-pipeline.yml文件:

pipelines:
  branches:
    master:
      - step:
          services:
            - docker
          caches:
            - docker
            - pip
            - composer
          name: Install server libs. Download and install composer. Build image, push to aws ecr, then deploy
          script:
            ...
            - git submodule update --init --recursive
            ...

当我运行管道时,出现以下错误:

+ git submodule update --init --recursive
Submodule 'laradock' (https://[email protected]/xxxx/laradock.git) registered for path 'laradock'
Cloning into '/opt/atlassian/pipelines/agent/build/laradock'...
fatal: could not read Password for 'https://[email protected]': No such device or address
fatal: clone of 'https://[email protected]/xxxx/laradock.git' into submodule path '/opt/atlassian/pipelines/agent/build/laradock' failed

我尝试将ssh密钥添加到访问密钥。一直工作到今天早上。任何帮助都会很棒。

git git-submodules bitbucket-pipelines
1个回答
0
投票

如果它需要HTTPS URL的密码,则意味着它是一个需要凭证的私有存储库。

如果您有权访问父仓库(包括laradock子模块),则可能要编辑.gitmodules并使用SSH URL,如果您是using SSH in your Bitbucket pipeline

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