我在网上2周以来一直在寻找解决方案,我真的需要一些帮助 .

我面临三个问题:

Linux Gitlab-runner没有运行

我一直试图用所有方式安装gilab-runner(GitLab's official repositorymanualydocker) .

每次,当我启动命令“gitlab-runner status”时,答案总是“服务器没有运行” . 我已经尝试了一百万次卸载服务并重新安装它,但我不想工作 . 我已经注册了各种类型的跑步者,有/没有sudo用户 . 没有任何成功 . 这是我的设置服务器:

配置

Ubuntu 16.04.1

Docker容器gitlab 9.4.3

港口:

  • webservice:8088

  • https:4433

  • ssh:2222

gitlab-runner 9.5.0

如何重现

加载:已加载(/etc/systemd/system/gitlab-runner.service;已启用;供应商预设:已启用)活动:激活(自动重启)(结果:退出代码),因为ven . 2017-08-25 15:17:45 CEST; 45s ago Process: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(代码=退出,状态= 1 / FAILURE)

systemd 1:gitlab-runner.service:单位进入失败状态 . systemd 1:gitlab-runner.service:结果'exit-code'失败 .

Windows gitlab-runner错误500

由于我在Linux中安装gitlab-runner的问题,我试图在Windows 10上的另一台计算机上安装它 . 它工作了,最后commande gitlab-runner状态回答我“服务正在运行”(但这只是一个临时解决方案) ,我真的需要让它在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

为什么有必要启动run命令让我的工作在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"

  • First Error :chdir / home / gitlab-runner:没有这样的文件或目录

  • Solution :sudo mkdir / home / gitlab-runner

  • Second Error :打开/etc/gitlab-runner/config.toml:权限被拒绝

  • Solution :sudo chmod 755 /etc/gitlab-runner/config.toml