centos 安装gitlab
- 安装依赖软件
yum -y install policycoreutils openssh-server openssh-clients postfix
2.设置postfix开机自启,并启动,postfix支持gitlab发信功能
systemctl enable postfix && systemctl start postfix
3.下载gitlab安装包,然后安装
centos 7系统的下载地址:https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7
我的是centos7,所以我在https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7中找了个gitlab8.0.0版本,建议下载一个比较新的版本,我这里选了一个比较旧的版本仅仅是实验
下载rpm包并安装:
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-8.0.0-ce.0.el7.x86_64.rpm //换版本直接改版本号
rpm -i gitlab-ce-8.0.0-ce.0.el7.x86_64.rpm
4.修改gitlab配置文件指定服务器ip和自定义端口:
vim /etc/gitlab/gitlab.rb
external_url 'http://localhost' 改成 http://ip:端口(默认8080)
5.重置并启动GitLab
执行:
gitlab-ctl reconfigure
gitlab-ctl restart
提示“ok: run:”表示启动成功
6.访问 GitLab页面
如果没有域名,直接输入服务器ip和指定端口进行访问
第一次登录修改密码
初始账户: root 密码: 刚刚修改的密码
7.汉化
安装git
yum install -y git
下载最新的汉化包
git clone https://gitlab.com/xhang/gitlab.git -b v10.0.2-zh //直接改版本号
安装依赖
yum install -y curl openssh-server openssh-clients postfix cronie policycoreutils-python
停止gitlab服务
gitlab-ctl stop
切换到gitlab汉化包所在的目录
cd /root/gitlab
比较汉化标签和原标签,导出 patch 用的 diff 文件到/root下
git diff v10.0.2 v10.0.2-zh > ../10.0.2-zh.diff //改成相应版本号
回到/root目录
cd
将10.0.2-zh.diff作为补丁更新到gitlab中
yum install patch -y
patch -d /opt/gitlab/embedded/service/gitlab-rails -p1 < 10.0.2-zh.diff
启动gitlab
gitlab-ctl start
重新配置gitlab
gitlab-ctl reconfigure
