繁体   English   中英

Gitlab Runner - 未定义listen_address

[英]Gitlab Runner - listen_address not defined

我正在我的 mac 上本地设置 gitlab-runner,以便能够使用 docker 运行构建和测试脚本。 我已经按照 Gitlab runners 页面上列出的安装说明在本地安装了 runner:

# Download the binary for your system
sudo curl --output /usr/local/bin/gitlab-runner https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-darwin-amd64

# Give it permissions to execute
sudo chmod +x /usr/local/bin/gitlab-runner

# The rest of commands execute as the user who will run the Runner
# Register the Runner (steps below), then run
cd ~
gitlab-runner install
gitlab-runner start

据我所知,它安装得很好。 然后我注册了一个像这样的跑步者:

sudo gitlab-runner register --url https://gitlab.com/ --registration-token $REGISTRATION_TOKEN

(我显然用我的令牌替换了$REGISTRATION_TOKEN )。 当它提示我提供其他详细信息时,我输入了以下内容:

  • 标签:(我留空了)
  • 输入一个执行器: docker
  • 输入默认的node:14.0.0镜像: node:14.0.0

然后我收到以下消息:

Runner注册成功。 随意启动它,但如果它已经在运行,配置应该会自动重新加载!

当我导航到我的项目的根目录时,我尝试运行 gitlab-runner run 但我收到以下错误:

Starting multi-runner from /Users/ben/.gitlab-runner/config.toml...  builds=0
WARNING: Running in user-mode.                     
WARNING: Use sudo for system-mode:                 
WARNING: $ sudo gitlab-runner...                   
                                                   
Configuration loaded                                builds=0
listen_address not defined, metrics & debug endpoints disabled  builds=0
[session_server].listen_address not defined, session endpoints disabled  builds=0
^CWARNING: [runWait] received stop signal             builds=0 stop-signal=interrupt
WARNING: Graceful shutdown not finished properly    builds=0 error=received stop signal: interrupt
WARNING: Starting forceful shutdown                 StopSignal=interrupt builds=0
All workers stopped. Can exit now                   builds=0

当我查看 config.toml 时,如果它看起来像上面的错误提示的那样可能缺少某些配置? 这是整个文件的猫:

concurrent = 1
check_interval = 0

[session_server]
  session_timeout = 1800

我不确定为什么会收到此错误消息? 我的配置看起来好吗? 在搜索问题时,我发现另一个线程说只是将“可以运行未标记的作业”设置为是,我已经完成了但它仍然不起作用......

您遇到配置问题是有道理的。

如果您仔细阅读输出,它会说您正在user-mode ,所以我想您是通过使用gitlab-runner启动了gitlab-runner

问题是您使用sudo注册了跑步者,因此您在/etc/gitlab-runner/下配置了system-mode 当您使用sudo启动gitlab-runner时会加载此配置。

为了验证这一点,您将能够在/etc/gitlab-runner/下看到已注册的配置,以及有关 Docker Runners 等的所有附加部分,而不是您在~/.gitlab-runner/下的基本配置- ~/.gitlab-runner/我想这是你附加到你的问题的那个。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM