GitlabRunner部署
前置条件
由于我们使用docker容器构建,所以必须要先安装docker环境,可以参考这两篇文章
下载对应平台的Runner二进制文件
shell
# https://gitlab.com/gitlab-org/gitlab-runner/-/releases/v17.5.2
curl -O https://gitlab.com/gitlab-org/gitlab-runner/-/releases/v17.5.2/downloads/binaries/gitlab-runner-linux-amd64
# 下载完毕后执行
mv gitlab-runner-linux-amd64 /usr/local/bin/gitlab-runner
chmod +x /usr/local/bin/gitlab-runner
mkdir /root/GitlabRunner
gitlab-runner install --user=root --working-directory=/root/GitlabRunner
gitlab-runner status
gitlab-runner list注册Runner
shell
gitlab-runner register --url http://192.168.100.128:20080 --token glrt-t1_LpWykWzVAtV7ghiPhqme
## Enter the GitLab instance URL (for example, https://gitlab.com/):
回车
## Enter a name for the runner. This is stored only in the local config.toml file:
输入Runner名称 回车
## Enter an executor
docker 回车
## Enter the default Docker image (for example, ruby:2.7):
registry.cn-shanghai.aliyuncs.com/odboy/ops:alinux3 回车
注销Runner
shell
gitlab-runner list
gitlab-runner stop --name [Runner名称] --token [Runner Token]
gitlab-runner unregister --name [Runner名称] --token [Runner Token]
