centos7下gitlab的搭建

本文搭建的gitlab是基于yum的方式进行安装的,具体的安装步骤如下:

(1)、配置yum源

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

(2)、复制如下内容并保存,注意baseurl的配置是centos7的地址

[gitlab-ce]

name=gitlab-ce

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

Repo_gpgcheck=0

Enabled=1

Gpgkey=https://packages.gitlab.com/gpg.ke

(3)、更新本地yum缓存

sudo yum makecache

(4)、yum安装gitlab,此处安装版本是10.2.2

sudo yum intall gitlab-ce        #自动安装最新版

sudo yum install gitlab-ce-10.2.2    #安装指定版本,此处为10.2.2

注意安装的过程中可能会报如下错误

sudo yum install gitlab-ce-10.2.2 --nogpgcheck      ####跳过校验

(5)、更改配置

vim /etc/gitlab/gitlab.rb

找到 external_url 'http://000.00.00.00:8081'

修改成你的地址,此处为http://192.168.1.157:8081

(6)、对GitLab进行编译

gitlab-ctl reconfigure

(7)、清除缓存

扫描二维码关注公众号,回复: 3551128 查看本文章
gitlab-rake cache:clear RAILS_ENV=production

(8)、启动gitlab服务,以及关闭防火墙等操作

sudo gitlab-ctl start    # 启动所有 gitlab 组件;并加入开机启动项里面:/etc/rc.local

sudo gitlab-ctl stop     # 停止所有 gitlab 组件;

sudo gitlab-ctl restart   # 重启所有 gitlab 组件;

sudo gitlab-ctl status    # 查看服务状态;

sudo gitlab-ctl tail       # 查看日志;

关闭防火墙:

systemctl stop firewalld.service  ###centos7关闭防火墙

(9)、访问gitlab:192.168.1.157:8081,gitlab默认的root账号密码为qazwsxed,首次进入需要修改root密码

参考:https://yq.aliyun.com/articles/628158?spm=a2c4e.11155472.0.0.5fd75edeKYCTdg

猜你喜欢

转载自blog.csdn.net/dabao87/article/details/82844411