搭建gitlab runner

1、搭建runner
镜像:gitlab/gitlab-runner:latest

2、注册runner,输入gitlab-runner register命令

root@runner-6f49c57c49-5889v:/# gitlab-runner register
Runtime platform                                    arch=amd64 os=linux pid=1054 revision=81ab07f6 version=16.10.0
Running in system-mode.                            
                                                   
Enter the GitLab instance URL (for example, https://gitlab.com/):
https://gitlab-XXX.com.cn/          ### 输入gitlab地址
Enter the registration token:
GR1348941szPTgrFCXXXXXXXXXX         ### 输入token,具体如图一
Enter a description for the runner:
[runner-6f49c57c49-5889v]: k8s-runner-cody      ### description
Enter tags for the runner (comma-separated):
k8s-runner-cody                      ### tags 名
Enter optional maintenance note for the runner:
k8s-runner-cody
WARNING: Support for registration tokens and runner parameters in the 'register' command has been deprecated in GitLab Runner 15.6 and will be replaced with support for authentication tokens. For more information, see https://docs.gitlab.com/ee/ci/runners/new_creation_workflow 
Registering runner... succeeded                     runner=GR1348941szPTgrFC
Enter an executor: docker, docker-windows, docker-autoscaler, ssh, shell, parallels, virtualbox, docker+machine, kubernetes, instance, custom:
shell       ### 填shell
Runner registered successfully. Feel free to start it, but if it's running already the config should be automatically reloaded!
 
Configuration (with the authentication token) was saved in "/etc/gitlab-runner/config.toml" 

图一:


如果出现报错:tls: failed to verify certificate: x509: certificate signed by unknown authority,需要将证书加到/usr/local/share/ca-certificates/目录下,再执行update-ca-certificates

posted @   Cody&  阅读(7)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?
点击右上角即可分享
微信分享提示