1.配置国内GitlabCI的yum源
[清华源](https://mirror.tuna.tsinghua.edu.cn/help/gitlab-ci-multi-runner/)
新建 /etc/yum.repos.d/gitlab-ci-multi-runner.repo,内容为
[gitlab-ci-multi-runner]
name=gitlab-ci-multi-runner
baseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ci-multi-runner/yum/el7
repo_gpgcheck=0
gpgcheck=0
enabled=1
gpgkey=https://packages.gitlab.com/gpg.key
2.安装gitlab-ci-multi-runner
sudo yum makecache
sudo yum install gitlab-ci-multi-runner
3.注册runner
sudo gitlab-ci-multi-runner register
根据提示完成配置
gitlab-ci coordinator URL 和 token的获取方式:
如下图
4.创建.gitlab-ci.yml
stages:
- test
job1:
stage: test
tags:
- test
script:
- echo "job1"
- echo "test"
5.查看结果
http://{自已的gitlab地址}/yeaxu(自已的组织名)/helloword(自已的项目名)/pipelines