一.安装要求:内存至少4G
二.安装
安装环境:centos7为例
1.安装依赖软件:
yum install -y curl policycoreutils-python openssh-server openssh-clients
systemctl enable sshd
systemctl start sshd
防火墙如果关闭了,下面的操作可以不做。防火墙关闭命令:systemctl stop firewalld
firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https
systemctl reload firewalld
2.设置gitlab的安装源:
1)如果在国内,使用清华源:
新建/etc/yum.repos.d/gitlab-ce.repo添加如下内容:
[gitlab-ce]
name=Gitlab CE Repository
baseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el$releasever/
gpgcheck=0
enabled=1
再执行:yum makecache
2)如果在国外(亲测国内也是可以用)
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
3.安装gitlab:
1)使用域名访问gitlab(域名可以自行定义,建议使用域名):
EXTERNAL_URL="https://gitlab.example.com" yum install -y gitlab-ce
2)不使用域名:yum install -y gitlab-ce
4.安装完成,运行下面命令进行配置:
gitlab-ctl reconfigure
5.访问方式:
登录修改密码,登录用户root,密码就是修改之后的密码。
由于没有使用域名,所以访问方式直接输入ip地址就可以了

6.安装gitlab-ci-multi-runner查看https://www.jianshu.com/p/22e60b9f0a96
安装完成之后:

7.设置docker权限:
usermod -aG docker gitlab-runner
service docker restart
gitlab-ci-multi-runner restart
8.gitlab-ci-multi-runner注册到gitlab上:

9.简单测试CI/CD:

网友评论