Gitlab流水线需要使用Gitlab Runner,这里介绍Ubuntu安装Gitlab Runner的方法。
Runner允许在一台机器上安装多个Runner,但每个Runner只能运行一个项目。
安装
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| $ curl -L"https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.deb.sh"| sudo bash $ sudo apt-get install gitlab-runner
$ curl -L"https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.rpm.sh"| sudo bash $ sudo yum install gitlab-runner
sudo gitlab-runner register
sudo gitlab-runner register \ --non-interactive \ --url "$HOST" \ --token "$RUNNER_TOKEN" \ --executor: "shell" --description "shell runner"
|
参数HOST是Gitlab地址,RUNNER_TOKEN是注册时生成的token