GitLab安装平台可以是GNU/Linux、MacOS、FreeBSD和Windows上
安装它有三种方法。
1.使用Docker;
2.手动下载二进制文件,
3.或者使用RPM/DEB包的存储库。
下面介绍使用RPM/DEB包的存储库安装方法:
声明:以下安装的是Gitlab Runner 10之前的版本
1.系统选择以下不同的安装命令。
For Debian/Ubuntu
curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-ci-multi-runner/script.deb.sh | sudo bash
For RHEL/CentOS
curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-ci-multi-runner/script.rpm.sh | sudo bash
2.安装好 GitLab Runner 之后,我们只要启动 Runner 然后和 GitLab CI 绑定:
[root@iZbp1fmnx8oyubksjdk7leZ gitbook]# gitlab-ci-multi-runner register
Running in system-mode.
Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com/):
http://192.168.75.146:8080/
Please enter the gitlab-ci token for this runner:
1Lxq_f1NRfCfeNbE5WRh
Please enter the gitlab-ci description for this runner:
[iZbp1fmnx8oyubksjdk7leZ]: deploy-gaming
Please enter the gitlab-ci tags for this runner (comma separated):
deploy
Whether to run untagged builds [true/false]:
[false]: true
Whether to lock Runner to current project [true/false]:
[false]:
Registering runner… succeeded runner=P_zfkhTb
Please enter the executor: virtualbox, docker+machine, parallels, shell, ssh, docker-ssh+machine, kubernetes, docker, docker-ssh:
shell
Runner registered successfully. Feel free to start it, but if it’s running already the config should be automatically reloaded!
说明:
gitlab-ci-multi-runner register:执行注册命令
Please enter the gitlab-ci coordinator URL:输入 ci 地址
Please enter the gitlab-ci token for this runner:输入 ci token
Please enter the gitlab-ci description for this runner:输入 runner 名称
Please enter the gitlab-ci tags for this runner:设置 tag
Whether to run untagged builds:这里选择 true ,代码上传后会能够直接执行
Whether to lock Runner to current project:直接回车,不用输入任何口令
Please enter the executor:选择 runner 类型,这里我们选择的是 shell
至此恭喜你安装注册完毕!
这一篇文章和 https://blog.youkuaiyun.com/qq_28372705/article/details/86006501
《在Ubuntu系统中安装GitLab 》都是做的持续集成测试,后续还有如何在工程中实现持续集成