GitLab搭建-使用清华大学开源软件镜像站

GitLab搭建

  • GitLab是什么
  • GitLab解决什么问题
  • GitLab搭建
  • GitLab博客

GitLab是什么。


     GitLab是一个用于仓库管理系统的开源项目;使用Git作为代码管理工具,并在此基础上搭建起来的web服务。
     1、Web框架使用Ruby on Rails
     2、基于MIT代码发布协议
     3、需要gitonlite协同工作

安装要求:

  • Ubuntu/Debian(推荐这2个系统,也可以安装到CentOS系统中,并且在GitHub上有CentOS的GitLab一键安装脚本)
  • ruby 1.9.3+
  • MySQL
  • git
  • gitolite
  • redis

GitLab解决什么问题。

       通过Web界面进行访问公开的或者私人项目,它拥有和github类似的功能,能够浏览源代码,管理缺陷和注释。可以管理团队对仓库的访问,它非常易于浏览提交过的版本并提供一个历史版本库。团队成员可以通过内置的聊天程序进行聊天,它还提供一个代码片段收集功能可以轻松实现代码复用。


GitLab搭建

  • 安装Linux系统,更改源。推荐阿里源和163源。具体参见我另一篇文章。
  • 访问GitLab中文官方网站或者官网。https://www.gitlab.cc/downloads/#centos6 或 https://about.gitlab.com/downloads/#ubuntu1204
  • 选择自己合适的系统进行按步骤安装。
CentOS 6
第一步:
sudo yum install curl openssh-server openssh-clients postfix cronie
sudo service postfix start
sudo chkconfig postfix on
sudo lokkit -s http -s ssh

第二步:注意这一步会出现无法定位gitlab-ce 办法如下解决
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
sudo yum install gitlab-ce

第三步:
sudo gitlab-ctl reconfigure

  • 在进行gitlab-ce下载的时候会错误“无法定位gitlab-ce”。其中原因是阿里源或者163源没有该映像,我这里找到一个解决办法是浙大或者清华大学提供的镜像。https://mirror.tuna.tsinghua.edu.cn/help/gitlab-ce/
  • Debian/Ubuntu 用户

      首先信任 GitLab 的 GPG 公钥:
curl https://packages.gitlab.com/gpg.key 2> /dev/null | sudo apt-key add - &>/dev/null

      再选择你的 Debian/Ubuntu 版本,文本框中内容写进/etc/apt/source.list.d/gitlab-ce.list
deb https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/ubuntu xenial main
      安装 gitlab-ce:
sudo apt-get update
sudo apt-get install gitlab-ce
  • CentOS/RHE
      新建 /etc/yum.repos.d/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

      再执行
sudo yum makecache
sudo yum install gitlab-ce



你可能感兴趣的:(gitlab,使用清华大学开源软件镜像站,GitLab搭建)