【发布时间】:2018-02-02 09:12:15
【问题描述】:
我在网上搜索了 2 周以来的解决方案,我真的需要一些帮助。
我面临三个问题:
Linux Gitlab-runner 没有运行
我一直在尝试以各种方式安装 gilab-runner(GitLab's official repository、manualy、docker)。
每次,当我启动命令“gitlab-runner status”时,答案总是“服务器没有运行”。我已经尝试了一百万次来卸载该服务并重新安装它,但我不想工作。我已经注册了各种类型的跑步者,并且有/没有 sudo 用户。没有任何成功。这是我的设置服务器:
配置
Ubuntu 16.04.1
Docker 容器 gitlab 9.4.3
端口:
- 网络服务:8088
- https : 4433
- ssh : 2222
gitlab-runner 9.5.0
如何重现
注册一个shell runner http://192.168.1.10:8088/
-
启动命令“sudo service gitlab-runner status”
已加载:已加载(/etc/systemd/system/gitlab-runner.service;已启用;供应商预设:已启用) 活动:激活(自动重启)(结果:退出代码)自 ven。 2017-08-25 15:17:45 CEST; 45 秒前 进程:13201 ExecStart=/usr/bin/gitlab-ci-multi-runner run --working-directory /home/gitlab-runner --config /etc/gitlab-runner/config.toml --service gitlab-runner -- syslog --user gitlab-runner (code=exited, status=1/FAILURE) 主 PID: 13201 (code=exited, status=1/FAILURE)
systemd1: gitlab-runner.service: 单元进入失败状态。 systemd1: gitlab-runner.service: 失败,结果为'exit-code'。
Windows gitlab-runner 错误 500
由于我在 Linux 中安装 gitlab-runner 的问题,我尝试将它安装在 Windows 10 的另一台计算机上。 它起作用了,最后命令 gitlab-runner status 回答我“服务正在运行”(但这只是一个临时解决方案,我真的需要让它在 linux 上运行)。 无论如何,我已经在测试程序中添加了一个 CI 脚本并启动了该工作,但它一遍又一遍地循环。 当我启动命令“gitlab-runner --debug run”时:
...
passfile: true
extension: cmd
job=183 project=19 runner=679ccd01
Using Shell executor... job=183 project=19 runner=679ccd01
Waiting for signals... job=183 project=19 runner=679ccd01
WARNING: Job failed: exit status 128 job=183 project=19 runner=679ccd01
WARNING: Submitting job to coordinator... failed job=183 runner=679ccd01 status=500 Internal Server Error
WARNING: Submitting job to coordinator... failed job=183 runner=679ccd01 status=500 Internal Server Error
...
Gitlab.com 并运行命令
所以我决定将我的项目添加到 gitlab.com 上进行测试。
git@gitlab.com:sandbox_test/test_ci.git
工作再次陷入无限循环,直到我在 Windows 计算机上启动命令“gitlab-runner run”。
Dialing: tcp gitlab.com:443 ...
Feeding runners to channel builds=0
Checking for jobs... received job=30315630 repo_url=https://gitlab.com/sandbox_test/test_ci.git runner=d98c0af1
Failed to requeue the runner: builds=1 runner=d98c0af1
Running with gitlab-ci-multi-runner 9.5.0 (413da38)
on Windows_shell_gitlab_com (d98c0af1) job=30315630 project=3992201 runner=d98c0af1
Shell configuration: environment: []
dockercommand: []
command: cmd
arguments:
- /C
passfile: true
extension: cmd
job=30315630 project=3992201 runner=d98c0af1
Using Shell executor... job=30315630 project=3992201 runner=d98c0af1
Waiting for signals... job=30315630 project=3992201 runner=d98c0af1
Job succeeded job=30315630 project=3992201 runner=d98c0af1
为什么需要启动运行命令才能让我在 gitlab.com 上工作? 我希望当我运行一项新工作时,它会自行解决,而无需在 CI 计算机上手动启动 gitlab-runner...
脚本 .gitlab-ci.yml在 CI Lint 上验证
stages:
- build
- test
- deploy
build:
stage: build
script:
- echo "building"
test:
stage: test
script:
- echo "test"
我真的非常需要答案,感谢您的帮助。 最好的问候,克莱门特
更新 1
我已经解决了部分问题:
Linux Gitlab-runner 没有运行
- 启动命令“gitlab-runner run --working-directory /home/gitlab-runner --config /etc/gitlab-runner/config.toml --service gitlab-runner --syslog --user gitlab-runner "
-
第一个错误:chdir /home/gitlab-runner:没有这样的文件或目录
- 解决方案:sudo mkdir /home/gitlab-runner
-
第二个错误:打开/etc/gitlab-runner/config.toml:权限被拒绝
- 解决方案:sudo chmod 755 /etc/gitlab-runner/config.toml
-
第一个错误:chdir /home/gitlab-runner:没有这样的文件或目录
【问题讨论】:
-
请将您的更新作为答案发布。我认为没有办法解决这个问题。
标签: linux shell gitlab gitlab-ci gitlab-ci-runner