转载来源 :https://mp.weixin.qq.com/s/kUwZja0xK1IfqGU6R2f1EA
一 GitLab Server的搭建
参考:https://about.gitlab.com/install/
1.准备工作
以centos7为例,准备一台至少内存为4G的机器。
系统版本:CentOS Linux release 7.3.1611 (Core)
软件版本:Gitlab-ce-11.10.1
硬件要求:最低2核4GB,建议4核8GB
2.安装依赖软件
[root@localhost ~]# sudo yum install -y git vim gcc glibc-static telnet
[root@localhost ~]# sudo yum install -y curl policycoreutiels-python openssh-server
[root@localhost ~]# sudo systemctl enable sshd
[root@localhost ~]# sudo systemctl start sshd
[root@localhost ~]# sudo yum install postfix -y
[root@localhost ~]# sudo systemctl enable postfix
[root@localhost ~]# sudo systemctl start postfix => 启动SSH远程服务
[root@localhost ~]# systemctl stop firewalld => 停止Firewalld防火墙服务
[root@localhost ~]# systemctl disable firewalld => 禁用Firwalld防火墙服务开机自启
[root@localhost ~]# sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/sysconfig/selinux => 关闭SeLinux(重启主机生效)
[root@localhost ~]# setenforce 0
3.设置gitlab安装源
国内的话就使用清华大学源,内容为:
[root@localhost ~]# vim /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
[root@localhost ~]# yum makecache
4、安装Gitlab
[root@localhost ~]# yum install -y gitlab-ce
可以访问"https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/"查看Gitlab-ce的版本。
安装历史版本请使用下面命令:
[root@localhost ~]# yum install