GitLab Runner 配置

757 阅读1分钟

配置文件 /srv/gitlab-runner/config/config.toml

全局的部分 concurrent 限制能够同时run多个job 0为不限制 log_level 可选项 debug, info, warn, error, fatal, panic check_interval 检查周期 检查新的job 单位秒 默认三秒

官方文档 docs.gitlab.com/runner/conf…

runners 部分

SettingDescription
nameRunner 的名字 描述
urlGitLab 地址
tokenThe Runner’s special token (not to be confused with the registration token)
tls-ca-fileFile containing the certificates to verify the peer when using HTTPS
tls-cert-fileFile containing the certificate to authenticate with the peer when using HTTPS
tls-key-fileFile containing the private key to authenticate with the peer when using HTTPS
limitLimit how many jobs can be handled concurrently by this token. 0 (default) simply means don’t limit
executorSelect how a project should be built, see next section
shellName of shell to generate the script. Default value is platform dependent.
builds_dirAbsolute path to a directory where builds will be stored in context of selected executor (Locally, Docker, SSH)
cache_dirAbsolute path to a directory where build caches will be stored in context of selected executor (locally, Docker, SSH). If the docker executor is used, this directory needs to be included in its volumes parameter.
environmentAppend or overwrite environment variables
request_concurrencyLimit number of concurrent requests for new jobs from GitLab (default 1)
output_limitSet maximum build log size in kilobytes, by default set to 4096 (4MB)
pre_clone_scriptCommands to be executed on the Runner before cloning the Git repository. this can be used to adjust the Git client configuration first, for example. To insert multiple commands, use a (triple-quoted) multi-line string or “\n” character.
pre_build_scriptCommands to be executed on the Runner after cloning the Git repository, but before executing the build. To insert multiple commands, use a (triple-quoted) multi-line string or “\n” character.
post_build_scriptCommands to be executed on the Runner just after executing the build, but before executing after_script. To insert multiple commands, use a (triple-quoted) multi-line string or “\n” character.
clone_urlOverwrite the URL for the GitLab instance. Used if the Runner can’t connect to GitLab on the URL GitLab exposes itself.
debug_trace_disabledDisables the CI_DEBUG_TRACE feature. When set to true, then debug log (trace) will remain disabled even if CI_DEBUG_TRACE will be set to true by the user.
refereesExtra job monitoring workers that pass their results as job artifacts to GitLab