Gitlab-ci runner是Gitlab-ci的運(yùn)行環(huán)境,可以選擇docker部署,也可以選擇服務(wù)器進(jìn)行部署。
Runner分為三種:specific runner、share runner、group runner
specific?runner:個(gè)人runner,只可以自己種,在同一個(gè)項(xiàng)目組的人無法使用。自己通過specific runner的token進(jìn)行創(chuàng)建個(gè)人的runner環(huán)境。
share runner和group runner 都是群組內(nèi)人員共享。所有人都可以用。當(dāng)CI運(yùn)行錯(cuò)誤時(shí),會(huì)給提交人發(fā)送郵件。
Install Runner:
# For Debian/Ubuntu/Mint
curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.deb.sh | sudo bash
sudo apt-get install gitlab-runner?
然后進(jìn)行Registering Runner

在gitlab-ci的setting中,選擇ci

group runner只有在群組管理員權(quán)限才可以設(shè)置。
在 specific runner下面,會(huì)有runner的url和token。
然后進(jìn)行runner的注冊:
1.Run the following command:
sudo gitlab-runner register
2.Enter your GitLab instance URL:
Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com )
https://gitlab.com
3.Enter the token you obtained to register the Runner:
Please enter the gitlab-ci token for this runner
xxx
4.Enter a description for the Runner, you can change this later in GitLab's UI:
Please enter the gitlab-ci description for this runner
[hostame] my-runner
4.Enter the?tags associated with the Runner, you can change this later in GitLab's UI: tag是用來在.gitlab-ci.yml中去指定用哪一個(gè)runner去運(yùn)行
Please enter the gitlab-ci tags for this runner (comma separated):?
my-tag,another-tag
5.Enter the?Runner executor:
Please enter the executor: ssh, docker+machine, docker-ssh+machine, kubernetes, docker, parallels, virtualbox, docker-ssh, shell:docker
7.If you chose Docker as your executor, you'll be asked for the default image to be used for projects that do not define one in?.gitlab-ci.yml:
Please enter the Docker image (eg. ruby:2.1):
alpine:latest
Runner executor,因?yàn)槲矣胹hell腳本,我只用了shell這一種。
這樣runner就在服務(wù)器裝好了,就可以在配置ci文件中去指定runner運(yùn)行了。
更多參照于官網(wǎng):GitLab Runner | GitLab