温馨提示:本文翻译自stackoverflow.com,查看原文请点击:其他 - Gitlab runner has not acces to submodule
gitlab gitlab-ci-runner

其他 - Gitlab运行程序尚未访问子模块

发布于 2020-03-27 15:53:13

我使用子模块创建了一个新项目,并希望运行gitlab-ci.yml。但是每次跑步者告诉我他无权访问或找不到该项目时。运行程序是Windows 10系统上的共享运行程序(必需)。它适用于较旧的项目,但不适用于新项目。

你有什么想法我做错了吗?

我已经做了什么:

  • 在另一个跑步者上测试
  • 使用获取和克隆为跑步者
  • 在运行器VM上手动运行git clone --recursive git @ gitlab ....
  • 在我当前的PC上克隆回购递归,它奏效了!
  • 一个答案

CI脚本:

stages:
  - build

variables:
  ARTIFACTS_OUTPUT_PATH: "./builds"
  GIT_SUBMODULE_STRATEGY: recursive

test_123:
    stage: build
    only:
        - tags
        - triggers
        - schedules
        - web
    script: 
        - some commands

    artifacts:
        paths:
          - ./builds/*
    tags:
        - windows

错误:

<!-- language: lang-sh -->
Cloning into 'C:/gitlab-runner/builds/765197b3/0/user/ttttttt'...
Submodule 'hfdg' (git@gitlab.XXXXXXXX:user/hfdg.git) registered for path 'hfdg'
Cloning into 'C:/gitlab-runner/builds/765197b3/0/user/ttttttt/hfdg'...
remote: 
remote: ========================================================================
remote: 
remote: The project you were looking for could not be found.
remote: 
remote: ========================================================================
remote: 
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
fatal: clone of 'git@gitlab.XXXXXXXX:user/hfdg.git' into submodule path 'C:/gitlab-runner/builds/765197b3/0/user/ttttttt/hfdg' failed
Failed to clone 'hfdg'. Retry scheduled
Cloning into 'C:/gitlab-runner/builds/765197b3/0/user/ttttttt/hfdg'...
remote: 
remote: ========================================================================
remote: 
remote: The project you were looking for could not be found.
remote: 
remote: ========================================================================
remote: 
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
fatal: clone of 'git@gitlab.XXXXXXXX:user/hfdg.git' into submodule path 'C:/gitlab-runner/builds/765197b3/0/user/ttttttt/hfdg' failed
Failed to clone 'hfdg' a second time, aborting

查看更多

查看更多

提问者
Luca
被浏览
58
Luca 2020-02-10 05:16

问题在于gitlab-runner没有分配给subrepo。因此,Runner尚未访问subrepo。