我为Gitlab配置了一个非常基本的集成,但是当它不得不克隆代码时,它几乎在一开始就失败了。
我的整合是:
image: node:latest
stages:
- build
- test
cache:
paths:
- node_modules/
- dist/
build-prod:
stage: build
script:
- npm install
- npm run build-prod
artifacts:
paths:
- node_modules/
- dist/
test_with_karma:
stage: test
script: ng test
我得到的错误是:
Running with gitlab-runner 11.7.0 (8bb608ff)
on fakehost 2eaf11ea
Using Docker executor with image node:latest ...
Pulling docker image node:latest ...
Using docker image sha256:8c67bfd7b95bdc535edc4a4144f5392b0f73efd6385fbcb47747d028d7059359 for node:latest ...
Running on runner-2eaf11ea-project-56-concurrent-0 via fakehost...
Cloning repository...
Cloning into '/builds/redacted/frontend'...
remote: You are not allowed to download code from this project.
fatal: unable to access 'https://gitlab-ci-token:xxxxxxxxxxxxxxxxxxxx@working-domain.com/redacted/frontend.git/': The requested URL returned error: 403
/bin/bash: line 65: cd: /builds/redacted/frontend: No such file or directory
ERROR: Job failed: exit code 1
这里有什么问题?
发布于 2019-02-01 06:05:23
检查这是否由第39469期覆盖
是啊-对我来说很管用。这个问题似乎有多种解决方案。为我工作的是#44855 总结一下。作为Gitlab的管理员并不意味着您可以在Gitlab中做任何您想做的事情。“无法访问”权限适用于登录到Gitlab并运行作业的人员。 要解决这个问题,运行作业的人员/帐户必须是项目的成员(主)。 这将适用于私人项目。 没有必要公开一个私人项目,尽管这似乎解决了问题。GITLAB建议您必须拥有项目的https才能使用http。解决方案--将您的帐户添加到项目中,即使您是管理员
和:
康拉德的描述是正确的。 您需要拥有运行管道的项目权限,但是,作为管理员,您可以启动任何管道。 当Gitlab中的Admin用户可以从命令行推动提交时,我就遇到了这种情况,尽管理论上没有项目的权利--而且管道失败了。 这种不一致需要纠正,要么管理用户不能推送/启动管道,没有权限,要么他应该真正地被授予所有项目的所有权利。我更喜欢第一个,因为它将gitlab管理与项目权限分开。有时我更喜欢没有完全的权利,就像在Linux下做非根的工作一样。
https://stackoverflow.com/questions/54468530
复制相似问题