搭建gitlab

1.防火墙开启http

# 添加http命令
sudo firewall-cmd --permanent --add-service=http
# 重启防火墙
sudo systemctl reload firewalld

2.安装Postfix邮件服务

# 安装
sudo yum install postfix
# 设置为开机自启动
sudo systemctl enable postfix
# 启动
sudo systemctl start postfix

3.安装GitLab

# 添加镜像
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-15.0.0-ce.0.el7.x86_64.rpm
# 安装
rpm -i gitlab-ce-15.0.0-ce.0.el7.x86_64.rpm

如果遇到下面这个问题

 

yum install policycoreutils-python  /sudo yum install -y curl policycoreutils-python openssh-server

# 将SSH服务设置成开机自启动
sudo systemctl enable sshd
# 启动SSH服务
sudo systemctl start sshd

4.修改配置文件

# 修改配置文件
vim /etc/gitlab/gitlab.rb     ip+端口号

 

 

 5.开放端口

# 开放端口,端口号随意
firewall-cmd --zone=public --add-port=端口号/tcp --permanent

#刷新防火墙
firewall-cmd --reload

6.启动gitlab

gitlab-ctl reconfigure
gitlab-ctl restart 重启

gitlab-ctl stop 停止服务

gitlab-ctl start 启动

gitlab-ctl status 查看状态

6.gitLab升级

1.备份当前gitlab

gitlab-rake gitlab:backup:create

2.配置yum源

vim  /etc/yum.repos.d/gitlab-ce.repo

#其中baseurl是镜像地址

 #[gitlab-ce]

name=Gitlab CE Repository 

baseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/

gpgcheck=0 

enabled=1

3.升级

yum install gitlab-ce-版本号

posted on 2022-04-15 22:12  棽犹  阅读(42)  评论(0编辑  收藏  举报

导航