Centos8 部署GitLab13

介绍

  • GitLab: 是一个机遇 Git 实现的在线代码仓库托管软件.
  • 基于 Ruby on rails 开发.
  • 集成了很多组件.
  • 社区版本为开源免费版.
  • 有完善的问题和追踪系统.
  • 8.0版开始,GitLab持续集成(CI)完全集成到GitLab本身,它还具有持续部署和持续交付功能,可用于构建、测试和部署你的应用程序。
  • CD/CI

GitLab 组件

  • Ngixn: 静态 Web 服务器.
  • gitlab-shell: 用于处理 Git 命令和修改 authorized keys 列表.
  • gitlab-workhorse: 轻量级的反向代理服务器.
  • logrotate: 日志文件管理工具.
  • postgresql: 数据库.
  • redis: 缓存数据库.
  • sidekiq: 用于在后台执行任务队列(一步执行).
  • unicorn: GitLab Rails 是应用在托管在这个服务器上面.

目录介绍

/var/opt/gitlab/git-data/repositories/   # 默认存储目录.
/opt/gitlab/                             # 应用代码和相应的依赖程序.
/var/opt/gitlab/                         # gitlab-ctl reconfigure 命令编译后的应用数据和配置文件,不需要人为修改.
/etc/gitlab/                             # 配置文件目录.
/var/log/gitlab/                         # 此目录下存放了 gitlab 各个组件生产的日志.
/var/opt/gitlab/backups/                 # 备份文件生成的目录.

安装gitlab

    官网安装介绍: https://about.gitlab.com/install/#centos-8

     清华大学镜站: https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el8/

    官网源站: https://packages.gitlab.com/gitlab/gitlab-ce

安装

dnf install policycoreutils-python-utils
[root@node1 ~]# rpm -ivh gitlab-ce-13.2.1-ce.0.el8.x86_64.rpm  

配置

配置访问的URl
[root@node1 ~]# vim /etc/gitlab/gitlab.rb 
external_url 'http://172.16.0.61'
配置 gitlab
sudo gitlab-ctl reconfigure

查看各组件状态

[root@node1 ~]# gitlab-ctl status
run: alertmanager: (pid 34082) 93s; run: log: (pid 33702) 290s
run: gitaly: (pid 34052) 98s; run: log: (pid 33179) 491s
run: gitlab-exporter: (pid 34040) 99s; run: log: (pid 33625) 326s
run: gitlab-workhorse: (pid 34027) 99s; run: log: (pid 33518) 370s
run: grafana: (pid 34097) 92s; run: log: (pid 33954) 132s
run: logrotate: (pid 33557) 354s; run: log: (pid 33567) 350s
run: nginx: (pid 33539) 365s; run: log: (pid 33547) 362s
run: node-exporter: (pid 34036) 99s; run: log: (pid 33606) 337s
run: postgres-exporter: (pid 34089) 92s; run: log: (pid 33731) 276s
run: postgresql: (pid 33315) 476s; run: log: (pid 33330) 472s
run: prometheus: (pid 34061) 98s; run: log: (pid 33672) 301s
run: puma: (pid 33461) 389s; run: log: (pid 33468) 388s
run: redis: (pid 33141) 498s; run: log: (pid 33152) 495s
run: redis-exporter: (pid 34045) 98s; run: log: (pid 33650) 312s
run: sidekiq: (pid 33479) 383s; run: log: (pid 33489) 382s

初始化密码

   访问:http:gitlab_ip

登录

汉化

旧版本汉化

1、下载汉化补丁 
git clone https://gitlab.com/xhang/gitlab.git 
2、查看全部分支版本 
git branch ‐a 
3、对比版本、生成补丁包 
git diff remotes/origin/10‐2‐stable remotes/origin/10‐2‐stable‐zh > ../10.2.2‐zh.diff 
4、停止服务器 
gitlab‐ctl stop 
5、打补丁
 patch ‐d /opt/gitlab/embedded/service/gitlab‐rails ‐p1 < /tmp/10.2.2‐zh.diff 
6、启动和重新配置 gitlab‐ctl start gitlab‐ctl reconfigure

新版本汉化

gitlab-13.2.1 已经支持中文版了

修改路径: 用户 - 配置 - 偏好配置 - 语言

gitlab常用命令

gitlab-ctl start      # 启动全部服务
gitlab-ctl restart    # 重启全部服务
gitlab-ctl stop       # 停止全部服务

gitlab-ctl reconfigure   # 重置配置文件(一般修改完主配置文件/etc/gitlab/gitlab.rb,需要执行此命令)
gitlab-ctl show-config   # 验证配置文件
gitlab-ctl uninstall     #删除gitlab(保留数据)
gitlab-ctl cleanse       # 删除所有数据,从新开始

gitlab-ctl tail <service name> #查看服务的日志

gitlab管理

猜你喜欢

转载自www.cnblogs.com/yanshicheng/p/13378833.html