GitLab服务器搭建

时间:2022-07-23
本文章向大家介绍GitLab服务器搭建,主要内容包括其使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。

1.软件准备

准备Centos7虚拟机 以下是百度网盘下载 提取码 6666 VMware-workstation-full-15 VMware15激活码 CG392-4PX5J-H816Z-HYZNG-PQRG2 CentOS-7-x86_64-DVD-1708.iso

2.环境准备

安装依赖
yum install -y curl policycoreutils-python openssh-server
关闭防火墙并禁用防火墙
systemctl stop firewalld
systemctl disable firewalld

3.安装GitLab

包含两种方式

3.1 [方式一] 设置gitlab安装源,下载最新版本
vim /etc/yum.repos.d/gitlab-ce.repo
[gitlab-ce]
name=gitlab-ce repository
baseurl=http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7
gpgcheck=0
enabled=1
yum install -y gitlab-ce

注意: GitLab有离线导入导出功能,如果两个GitLab服务器版本不一致,容易导致导入失败,这种情况就可以使用指定版本安装。

3.2 [方式二]下载指定版本并安装
yum install -y gitlab-ce-10.4.1-ce.0.el7.x86_64.rpm
安装成功

4. GitLab启动及使用

修改配置
vim /etc/gitlab/gitlab.rb
# 修改访问IP
external_url 'http://192.168.227.129:8085'
启动
gitlab-ctl reconfigure
查看状态
gitlab-ctl status
UI界面

http://192.168.227.129:8085 首次登陆需要设置密码 eg: 12345678 账号为 root