giitlab安装

giitlab安装

1.配置源

1
2
3
4
5
6
7
在 /etc/yum.repos.d/ 下新建 gitlab-ce.repo,写入如下内容:
[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.key

2.然后创建cache,再直接安装gitlab-ce

1
yum makecache  # 这一步会创建大量的数据

3.安装gitlab

1
2
3
4
5
6
7
8
# 直接安装最新版
yum install -y gitlab-ce

# 如果要安装指定的版本,在后面填上版本号即可
yum install -y gitlab-ce-13.6.1

# 如果安装时出现gpgkey验证错误,只需在安装时明确指明不进行gpgkey验证
yum install gitlab-ce -y --nogpgcheck

4.gitlab的配置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
vi /etc/gitlab/gitlab.rb
external_url 'https://192.168.0.170'

解决没有使用 letsencrypt 证书
letsencrypt['enable'] = false


gitlab-ctl reconfigure # 重载配置文件
gitlab-ctl start # 启动所有 gitlab 组件
gitlab-ctl stop # 停止所有 gitlab 组件
gitlab-ctl restart # 重启所有 gitlab 组件
gitlab-ctl status # 查看服务状态

gitlab-ctl reconfigure # 启动服务
gitlab-ctl show-config # 验证配置文件

gitlab-ctl tail # 查看日志

gitlab-rake gitlab:check SANITIZE=true --trace # 检查gitlab

初始用户名:root
初始密码:在这个文件里
/etc/gitlab/initial_root_password

giitlab安装
http://example.com/2023/08/08/giitlab安装/
作者
zgx
发布于
2023年8月8日
许可协议