1. 服务的下载、安装和卸载
1. 环境配置
建议配置:
- cpu:8核
- 内存:32G
- 硬盘:建议网络存储,raid 0
实验环境:
- cpu:2核
- 内存:4G
- 硬盘:虚拟磁盘
- ip:192.168.0.130
- 操作系统:Ubuntu 18.04.4 LTS
- 安装版本:gitlab-ce_11.11.8-ce(汉化支持兼容性高)
2. 下载、安装
安装包下载位置(gitlab-ce_11.11.8-ce):
清华源 七牛
1 | # 下载安装包 |
3. 相关文件
- /etc/gitlab 配置文件目录
- /run/gitlab 运行pid目录
- /opt/gitlab 安装目录
- /var/opt/gitlab 数据目录,重要,代码位置
- /var/log/gitlab 日志目录
2. 服务的启动、停止和汉化
1. 启动和停止
1 | # 启动服务 |
2. 汉化
汉化项目地址1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23# 查看gitlab的版本号
root@gitlab:~# cat /opt/gitlab/version-manifest.txt
#下载汉化包
root@gitlab:~# wget https://gitlab.com/xhang/gitlab/-/archive/v11.11.8-zh/gitlab-v11.11.8-zh.zip
# 停止gitlab
root@gitlab:~# gitlab-ctl stop
# 备份原数据
root@gitlab:~# cp -rp /opt/gitlab/embedded/service/gitlab-rails /opt/gitlab-rails.bak
# 解压汉化包
root@gitlab:~# tar -xvf gitlab-v11.11.8-zh-.tar.gz
# 汉化
root@gitlab:~# cp -rf gitlab-v11.11.8-zh/* /opt/gitlab/embedded/service/gitlab-rails/
# 重新读取配置文件
root@gitlab:~# gitlab-ctl reconfigure
#启动gitlab
root@gitlab:~# gitlab-ctl start
3. 服务的升级和降级
暂无
4. 服务数据的备份和恢复
1 | step1:停止gitlab的相关服务,但是不能全部关掉 |
5. 服务的高可用和扩展
暂无
6. 服务的dockerfile和k8s.yml
暂无
7. 基本使用
暂无
8. 经典案例
暂无
9. 服务存在的问题及其解决办法
python-gitlab
https://github.com/python-gitlab/python-gitlab
文档地址:
https://python-gitlab.readthedocs.io/en/v1.15.0/install.html