gitlab持续集成

批量注册gitlab-ci-multi-runner,可以服务多个项目

1、下载源

# For Debian/Ubuntu

curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-ci-multi-runner/script.deb.sh | sudo bash

# For CentOS

curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-ci-multi-runner/script.rpm.sh | sudo bash

2、安装

# For Debian/Ubuntu

sudo apt-get install gitlab-ci-multi-runner

# For CentOS

sudo yum install gitlab-ci-multi-runner

3、gitlab-runner注册关联gitlab

$ sudo gitlab-ci-multi-runner register

Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com )

http://git.gitlab.cn/        //服务器域名

Please enter the gitlab-ci token for this runner

tokenxxx-xxx-xxx    //token密钥,这个只是在gitlab界面,进入个人admin setting里的runner查看

Please enter the gitlab-ci description for this runner

gitlab-my-server

INFO[0034] fcf5c619 Registering runner... succeeded

Please enter the executor: shell, docker, docker-ssh, ssh?

shell

Please enter the Docker image (eg. ruby:2.1):

php,node,server

INFO[0037] Runner registered successfully. Feel free to start it, but if it's

running already the config should be automatically reloaded!


备注:

当token为全局的runner里时,创建出来的为共享的shared Runners 

当token是从单个项目的CI/CD里取出时,创建出来的是单个项目服务的

你可能感兴趣的:(gitlab持续集成)