gitlab runner使用目录路径而不是URL进行克隆;以“失败”;似乎不是git存储库;

gitlab runner使用目录路径而不是URL进行克隆;以“失败”;似乎不是git存储库;,gitlab,gitlab-ci,gitlab-ci-runner,Gitlab,Gitlab Ci,Gitlab Ci Runner,我试图在本地运行我的GitLab CI测试,以加快CI的开发速度 我在本地(在我的GNU/Linux机器上)安装了gitlab runner,如下所示 现在,当我运行sudo gitlab runner exec docker test时,我得到: sudo gitlab-runner exec docker test Runtime platform arch=amd64 os=linux pid=7133 revision

我试图在本地运行我的GitLab CI测试,以加快CI的开发速度

我在本地(在我的GNU/Linux机器上)安装了
gitlab runner
,如下所示

现在,当我运行sudo gitlab runner exec docker test时,我得到:

sudo gitlab-runner exec docker test
Runtime platform                                    arch=amd64 os=linux pid=7133 revision=0e5417a3 version=12.0.1
Running with gitlab-runner 12.0.1 (0e5417a3)
Using Docker executor with image joyzoursky/python-chromedriver:2.7 ...
Pulling docker image joyzoursky/python-chromedriver:2.7 ...
Using docker image sha256:f593ebe67d0c75eb8e3d663412c8fc80df70bd08e835d7a64ba6afa21b1c2d8a for joyzoursky/python-chromedriver:2.7 ...
Running on runner--project-0-concurrent-0 via hostname...
Fetching changes...
Initialized empty Git repository in /builds/project-0/.git/
Created fresh repository.
fatal: '/home/USER/path/to/repo' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
ERROR: Job failed: exit code 1
FATAL: exit code 1                                 
/home/USER/path/to/repo
是指向我的工作目录的实际路径,其中包含
.gitlab ci.yml
,以及我的项目代码)

因此,
gitlab runner
似乎试图将目录路径用作git克隆URL,这显然是行不通的

我试图指定
--clone url=
,但我不明白应该使用完整项目url的哪一部分(在主git repo或gitlab镜像中)


有什么线索吗?

如果您使用Fedora并启用了SELinux;尝试将其设置为“允许”:

sudo set0
SELinux阻止某些现有策略不允许的任何活动。GitLab runner基本上是一个docker容器,试图访问主机上的文件,因此会被阻止……这会导致runner报告您在上没有有效的存储库(如果出现一个错误,说它无法读取文件,这会更有意义,但我们并不是生活在一个完美的世界中)

懒散的解决方法是让SELinux毯子允许该活动,例如,如果您不经常做这种事情来保证策略更改的话

更具安全意识的人更愿意编辑策略。找出拒绝错误中的某个唯一标识符,然后创建一个新策略来允许它

sudo grep/var/log/audit/audit.log | audit2allow-M gitlab
sudo semodule-i gitlab.pp

是一个git回购吗?是的!但我猜Docker映像无法通过该路径访问回购协议,因为它只存在于我的工作站上,而不存在于Docker映像中?同样,这是一个答案,因为它回答了一个问题,我们可以得到更多关于为什么会这样的解释吗?