Redhat7.5 安装 使用 GitLab

版本选择

如果想安装指定版本,需要在下面的网站中下载指定版本。

  1. GitLab资源库
  2. GitLab资源库社区版
  3. GitLab资源库企业版

安装社区版

官方安装文档

  1. 安装并配置依赖(必要)

    1
    2
    3
    4
    5
    6
    # sudo yum install -y curl policycoreutils-python openssh-server
    # sudo systemctl enable sshd
    # sudo systemctl start sshd

    # sudo firewall-cmd --permanent --add-service=http
    # sudo systemctl reload firewalld
  2. 安装Postfix(用来发送通知电子邮件)

    1
    2
    3
    # sudo yum -y install postfix
    # sudo systemctl enable postfix
    # sudo systemctl start postfix
  3. 添加GitLab包存储库

    1
    # curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
  4. 安装GitLab包(将http://gitlab.resoft.css.com.cn作为您要访问GitLab的域名。安装过程将自动配置并启动该域名的GitLab)

    1
    # EXTERNAL_URL="http://gitlab.resoft.css.com.cn" yum install -y gitlab-ce
  5. 相关命令

    • 查看运行状态
      1
      # sudo gitlab-ctl status
    • 启动
      1
      # sudo gitlab-ctl start
    • 停止
      1
      # sudo gitlab-ctl stop
    • 重启
      1
      # sudo gitlab-ctl restart
    • 查看版本
      1
      2
      # cat /opt/gitlab/embedded/service/gitlab-rails/VERSION
      11.4.3-ee

配置并使用

  1. 浏览域名(http://gitlab.resoft.css.com.cn)并登陆
    首次访问时,您将被重定向到密码重置页面。设置初始管理员帐户的密码。使用默认帐户的用户名root登录。
  2. 配置语言
    选择用户头像->点Setting->选择Profile,将Preferred Language改成简体中文后保存即可

参考

在CentOS 7 1804 中 安装 使用 GitLab