安装gitlab-runner
sentos
下载
wget http://mirrors.tuna.tsinghua.edu.cn/gitlab-runner/yum/el7/gitlab-runner-12.9.0-1.x86_64.rpm
安装
rpm -ivh gitlab-runner-12.9.0-1.x86_64.rpm
ubuntu
下载
wget http://mirrors.tuna.tsinghua.edu.cn/gitlab-runner/ubuntu/pool/bionic/main/g/gitlab-runner/gitlab-runner_12.9.0_amd64.deb
安装
sudo dpkg -i gitlab-runner_12.9.0_amd64.deb
注册步骤
获取runner token -》 进行注册
http://192.168.3.30/admin/runners
在 Runner 设置时指定以下 URL: http://192.168.3.30/
在安装过程中使用以下注册令牌: JBGL_io2DqeQkzv_Bfd6
交互式注册
[root@ELK-node2 ~]# gitlab-runner register
Runtime platform arch=amd64 os=linux pid=1409 revision=4c96e5ad version=12.9.0
Running in system-mode.
Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com/):
http://192.168.3.30/
Please enter the gitlab-ci token for this runner:
JBGL_io2DqeQkzv_Bfd6
Please enter the gitlab-ci description for this runner:
[ELK-node2]: buildtest
Please enter the gitlab-ci tags for this runner (comma separated):
build
Registering runner... succeeded runner=JBGL_io2
Please enter the executor: custom, docker-ssh, parallels, ssh, docker+machine, kubernetes, docker, shell, virtualbox,docker-ssh+machine:
shell
Runner registered successfully. Feel free to start it, but if it's running already the config should be automaticallyreloaded!
注册相关命令
gitlab-runner register #默认交互模式下使用
gitlab-runner list #此命令列车保存在配置文件中的所有运行程序
gitlab-runner verify #此命令检查注册的runner是否可以连接
gitlab-tunner unregister #该命令使用gitlab取消已注册的runner
gitlab-tunner unregister --url http://192.168.3.30/ --token JBGL_io2DqeQkzv_Bfd6