CentOS搭建:GitLab
accttodo 12/31/2024 Linux
目录
参考:
- CentOS7安装GitLab及基本使用 (opens new window)
- Centos7 搭建 GitLab服务 下载-安装-配置-卸载 完整版 (opens new window)
- CentOS7系统安装GitLab (opens new window)
- 【15.x.x】centos7中部署GitLab(超详细) (opens new window)
- 【15.x.x】CentOS7下安装GitLab (opens new window)
- 【14.x.x】centos7安装部署gitlab (opens new window)
- Centos7.x搭建gitlab环境与软件卸载 (opens new window)
- Gitlab 设置页面语言为简体中文 (opens new window)
- CI/CD笔记.Gitlab系列:设置GitLab导入源 (opens new window)
- 修改gitlab默认仓库存储目录并迁移数据 (opens new window)
- gitlab项目中启用或禁用 GitLab CI/CD Pipeline (opens new window)
- 将某个GitLab上的项目同步到另一个GitLab (opens new window)
- 手把手教你在多个gitlab库之间同步代码(镜像) (opens new window)
# CentOS搭建:GitLab
# 环境依赖
软件/系统 | 版本 | 架构 | 包名 | 备注 |
---|---|---|---|---|
Linux | CentOS7.X | x86_64 | gitlab-ce-16.x.x |
#
以下参考:Gitlab 搭建 (opens new window)
二、gitlab安装目录
以下是gitlab常用的默认安装目录
- gitlab组件日志路径:/var/log/gitlab
- gitlab配置路径:/etc/gitlab/ 路径下有gitlab.rb配置文件
- 应用代码和组件依赖程序:/opt/gitlab
- 各个组件存储路径: /var/opt/gitlab/
- 仓库默认存储路径 /var/opt/gitlab/git-data/repositories
- 版本文件备份路径:/var/opt/gitlab/backups/
- nginx安装路径:/var/opt/gitlab/nginx/
- redis安装路径:/var/opt/gitlab/redis****
三、Gitlab 常用命令汇总
#查看服务状态
gitlab-ctl status
使用控制台实时查看日志
# 查看所有的logs; 按 Ctrl-C 退出
gitlab-ctl tail
# 拉取/var/log/gitlab下子目录的日志
gitlab-ctl tail gitlab-rails
# 拉取某个指定的日志文件
gitlab-ctl tail nginx/gitlab_error.log
#启动关闭gitlab
gitlab-ctl start
gitlab-ctl stop #停止
gitlab-ctl status #查看状态
gitlab-ctl restart #重启
gitlab-ctl reconfigure #更新配置文件
gitlab-ctl help #帮助
gitlab-rake gitlab:check SANITIZE=true --trace 检查gitlab
#gitlab 默认的日志文件存放在/var/log/gitlab 目录下
gitlab-ctl tail #查看所有日志
#禁止 Gitlab 开机自启动
systemctl disable gitlab-runsvdir.service
#启用 Gitlab 开机自启动
systemctl enable gitlab-runsvdir.service
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31