gitlab-ce的安装

介绍

GitLab是一个很好的git的web管理系统,其免费版本GitLab-CE也足够满足一般的需求。

GitLab官网:https://about.gitlab.com/

gitlab-ce: 社区版 免费 中小型企业

gitlab-ee: 企业版 收费 功能相对较多

区别对比:https://about.gitlab.com/features/#compare
下载参考:https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/

安装

 ## 打开系统防火墙HTTP和SSH访问
 yum install curl policycoreutils openssh-server openssh-clients
 systemctl enable sshd
 systemctl start sshd
 ## 安装邮件服务
 yum install postfix
 systemctl enable postfix
 systemctl start postfix
 ## 开启防火墙服务
 firewall-cmd --permanent --add-service=http
 systemctl reload firewalld 
 ## 添加GitLab镜像源并安装
 curl -sS http://packages.gitlab.com.cn/install/gitlab-ce/script.rpm.sh | sudo bash  <慢>
	这是官方的yum源,安装速度会比较慢,可以使用国内源,修改如下文件即可:

	vim /etc/yum.repos.d/gitlab_gitlab-ce.repo
       修改内容如下:
        [gitlab-ce]
        name=gitlab-ce
        baseurl=http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7
        repo_gpgcheck=0
        gpgcheck=0
        enabled=1
        gpgkey=https://packages.gitlab.com/gpg.key
  ## 安装gitlab-ce
   yum install -y gitlab-ce
  ## 配置服务并启动
   gitlab-ctl reconfigure
  ## 访问
    http://ip
  ## 初始账号是root  密码是随机密码,去密码文件 /etc/gitlab/initial_root_password  查询

安装成功截图

服务启动后和随机密码查询如下:

访问页面:

登录成功:

修改密码

汉化

下载最新的汉化包:

git clone https://gitlab.com/xhang/gitlab.git

如果是要下载老版本的汉化包,需要加上老版本的分支,如果想下载10.0.2,可以运行如下语句:

git clone https://gitlab.com/xhang/gitlab.git -b v10.0.2-zh

停止GitLab并执行如下语句:

gitlab-ctl stop
cp  /home/local/gitlab/*  /opt/gitlab/embedded/service/gitlab-rails/  -rf

复制时可能不断提示是否要覆盖,这时可能是系统每次执行cp命令时,其实是执行了cp -i命令的别名。出现这种情况可以修改~/.bashrc,在“alias cp=’cp-i’”前加#注释即可。

复制可能出现如下提示,可以不用理会。

img

注释后记得执行:

source ~/.bashrc

或者重启即可。

接下来可以重新配置和启动:
sudo gitlab-ctl reconfigure
sudo gitlab-ctl restart

--- 仅供参考

hhy_0602@163.com
原文地址:https://www.cnblogs.com/huhongy/p/14944632.html