江明涛的博客
centos7 安装gitlab-runner
centos7 安装gitlab-runner

centos7 安装gitlab-runner

1.下载安装包并赋予权限

sudo wget -O /usr/local/bin/gitlab-runner https://gitlab-ci-multi-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-ci-multi-runner-linux-amd64 && sudo chmod +x /usr/local/bin/gitlab-runner

2.创建gitlab ci用户

 useradd --comment 'GitLab Runner' --create-home gitlab-runner --shell /bin/bash
 gitlab-runner install --user=gitlab-runner --working-directory=/home/gitlab-runner
 gitlab-runner start
# 需要给gitlab-runner用户相关执行分配权限 或者直接使用root用户 不建议

gitlab-runner install --user=root
 gitlab-runner start

3.注册 gitlab-runner

#sudo gitlab-runner register
Running in system-mode.

Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com/):
#项目地址
http://127.0.0.1:30000/
Please enter the gitlab-ci token for this runner:#token http://127.0.0.1:30000//admin/runners 页面查看
8nk3UsLs78fzZCV8p88Mc
Please enter the gitlab-ci description for this runner:
[gitlab]: shell-2
Please enter the gitlab-ci tags for this runner (comma separated):
shell
Whether to run untagged builds [true/false]:
[false]: true
Whether to lock Runner to current project [true/false]:
[false]: false
Registering runner... succeeded                     runner=8nk3UsLs
Please enter the executor: docker-ssh+machine, kubernetes, parallels, shell, ssh, virtualbox, docker+machine, docker, docker-ssh:
shell
Runner registered successfully. Feel free to start it, but if it's running already the config should be automatically reloaded!

上次更新时间 13 3 月, 2023 at 09:59 上午