gitlab runner安装
gitlab runner安装
Debian/Ubuntu 用户
1.首先信任 GitLab 的 GPG 公钥:
curl https://packages.gitlab.com/gpg.key 2> /dev/null | sudo apt-key add - &>/dev/null
2.修改清华源:
vim /etc/apt/sources.list.d/gitlab-runner.list deb http://mirrors.tuna.tsinghua.edu.cn/gitlab-runner/debian buster main
3.安装 gitlab-runner:
sudo apt-get update sudo apt-get install gitlab-runner
CentOS/RHEL
新建 /etc/yum.repos.d/gitlab-runner.repo,内容为
[gitlab-runner] name=gitlab-runner baseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-runner/yum/el$releasever/ repo_gpgcheck=0 gpgcheck=0 enabled=1 gpgkey=https://packages.gitlab.com/gpg.key
再执行
sudo yum makecache sudo yum install gitlab-runner
4.启动
gitlab-runner start
5.注册runner
gitlab-runner register
运行:
gitlab-runner run
6.docker其他操作 (貌似可以忽略!)
sudo groupadd docker #添加docker用户组 sudo gpasswd -a gitlab-runner docker #将登陆用户加入到docker用户组中 newgrp docker #更新用户组 su gitlab-runner #切换到runner用户组 docker ps #测试docker命令是否可以使用sudo正常使用
7.docker gitlab部署安装
docker pull beginor/gitlab-ce:11.3.0-ce.0 docker run --detach --publish 8443:443 --publish 8880:80 --publish 8822:22 --name my-gitlab --restart unless-stopped --volume /Users/ys/svn_git/05Docker_workspace/gitlab/etc:/etc/gitlab --volume /Users/ys/svn_git/05Docker_workspace/gitlab/log:/var/log/gitlab --volume /Users/ys/svn_git/05Docker_workspace/gitlab/data:/var/opt/gitlab --privileged=true -d beginor/gitlab-ce:11.3.0-ce.0
8.测试
提交代码,测试,是否触发CI
相关链接
https://mirror.tuna.tsinghua.edu.cn/help/gitlab-runner/
https://github.com/sunhongdou/gitlab-cicd
相关推荐
cxin 2020-11-06
synshitou 2020-10-21
Topbeyond 2020-08-21
happyfreeangel 2020-07-27
白开水 2020-07-19
无风的雨 2020-07-08
贤时间 2020-07-06
wishli 2020-06-28
小信 2020-06-21
leehbhs 2020-06-20
happyfreeangel 2020-06-18
83284950 2020-06-17
冯冯领队 2020-06-16
就是那个胖子 2020-06-14
83284950 2020-06-14
LiHansiyuan 2020-06-14
fcds00 2020-06-11
就是那个胖子 2020-06-11