Gitlab 首接触

引子

团队内部Git仓库管理工具
之前Git仓库管理用的是gitosis,这个工具搭建起来比较麻烦,而且没有可视化工具,不是很方便

软件基础

  • CentOS 7
  • gitlab 9.1.4

安装

安装基础软件依赖包

1
sudo yum install curl policycoreutils openssh-server openssh-clients

开启sshd 服务

1
2
sudo systemctl enable sshd 
sudo systemctl start sshd

开放web端口

1
2
3
4
5
firewall-cmd --permanent --add-port=80/tcp //–permanent #永久生效,没有此参数重启后失效
firewall-cmd --list-ports //可以查看端口
firewall-cmd --reload #重启firewall
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动

添加gitlab国内yum源,并安装

1
2
curl -sS http://packages.gitlab.cc/install/gitlab-ce/script.rpm.sh | sudo bash
sudo yum install gitlab-ce

结束以后的显示

1
2
3
4
5
6
7
8
9
10
11
12
13
gitlab: Thank you for installing GitLab!
gitlab: To configure and start GitLab, RUN THE FOLLOWING COMMAND:

sudo gitlab-ctl reconfigure

gitlab: GitLab should be reachable at http://localhost
gitlab: Otherwise configure GitLab for your system by editing /etc/gitlab/gitlab.rb file
gitlab: And running reconfigure again.
gitlab:
gitlab: For a comprehensive list of configuration options please see the Omnibus GitLab readme
gitlab: https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md
gitlab:
It looks like GitLab has not been configured yet; skipping the upgrade script.

可以看到你的gitlab的配置文件路径 /etc/gitlab/gitlab.rb
修改完配置文件以后哦可以通过 gitlab-ctl reconfigure 来重载配置文件

先看运行效果

1
gitlab-ctl reconfigure //第一次时间比较长

远程访问使用IP