gitlab本地部署

1.安装依赖包
[root@localhost home]# yum install -y curl policycoreutils-python openssh-server postfix vim wget git patch

2.在系统防火墙中打开HTTP和HTTPS,设置SSH、邮件开机启动
[root@localhost ~]# systemctl restart firewalld
[root@localhost ~]# firewall-cmd --permanent --add-service=http
[root@localhost ~]# firewall-cmd --permanent --add-service=https
[root@localhost ~]# systemctl reload firewalld
[root@localhost ~]# systemctl enable sshd
[root@localhost ~]# systemctl start sshd
[root@localhost ~]# systemctl enable postfix
[root@localhost ~]# systemctl start postfix

3.配置YUM源
[root@localhost home]# weget https://mirror.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-10.0.0-ce.0.el7.x86_64.rpm
[root@localhost home]# vim /etc/yum.repos.d/gitlab.repo #清华大学开源软件镜像站
[gitlab]
name=gitlab
baseurl=https://mirrors.tuna.tsiighua.edu.cn/gitlab-ce/yum/el7/ #根据系统版本配置
repo_gpgcheck=0
gpgcheck=0
enabled=1
gpgkey=https://packages.gitlab.com/gpg.key

4.安装gitlab
[root@localhost home]# yum clean all
[root@localhost home]# yum makecache
[root@localhost home]# yum install -y gitlab-ce-10.0.0-ce.0.el7.x86_64.rpm
[root@localhost home]# vim /etc/gitlab/gitlab.rb #external_url 'http://192.168.3.178'
[root@localhost home]# gitlab-ctl reconfigure #重新配置gitlab
[root@localhost home]# gitlab-ctl status #查看gitlab状态
[root@localhost home]# netstat -tnlp #查看端口

5.中文汉化
[root@localhost home]# cat /opt/gitlab/embedded/service/gitlab-rails/VERSION #查看gitlab版本
[root@localhost home]# gitlab-ctl stop #停止服务,否则会出错
[root@localhost home]# git clone https://gitlab.com/xhang/gitlab.git -b v10.0.0-zh #克隆获取汉化版本库
[root@localhost home]# cat gitlab/VERSION #查看该汉化补丁的版本
[root@localhost home]# cd gitlab/
[root@localhost gitlab]# git diff v10.0.0 v10.0.0-zh > ../10.0.0-zh.diff #比较汉化标签和原标签,导出patch用的diff文件到/home下
[root@localhost gitlab]# cd ../
[root@localhost home]# patch -d /opt/gitlab/embedded/service/gitlab-rails -p1 < 10.0.0-zh.diff  #将10.0.0-zh.diff更新到gitlab中
[root@localhost home]# gitlab-ctl reconfigure #重新配置gitlab
[root@localhost home]# gitlab-ctl start

你可能感兴趣的:(gitlab本地部署)