侧边栏壁纸
博主头像
小周的知识站 博主等级

行动起来,活在当下

  • 累计撰写 80 篇文章
  • 累计创建 12 个标签
  • 累计收到 8 条评论

目 录CONTENT

文章目录

GitLab

Administrator
2024-06-20 / 0 评论 / 0 点赞 / 5 阅读 / 0 字

GitLab

1 GitLab简介

GitLab 是一个用于仓库管理系统的开源项目,使用Git作为代码管理工具,可通过Web界面进行访问公开的或者私人项目,非常适合在团队内部使用。

  • 官网:https://about.gitlab.com/

  • 参考文档:https://docs.gitlab.com/ee/ci/

  • 环境要求:至少2G内存(实验)生产(至少4G)

  • 版本介绍: CE(社区版)、EE(企业版)

  • GitLab占用端口:80、8080、9090端口(8080端口后期会与Jenkins冲突)

2 安装GitLab

[root@git ~]# yum -y install gitlab-ce-14.1.0-ce.0.el7.x86_64.rpm

. .

*** ***

***** *****

.****** *******

******** ********

,,,,,,,,,***********,,,,,,,,,

,,,,,,,,,,,*********,,,,,,,,,,,

.,,,,,,,,,,,*******,,,,,,,,,,,,

,,,,,,,,,*****,,,,,,,,,.

,,,,,,,****,,,,,,

.,,,***,,,,

,*,.

_______ __

/ ____(_) /_/ / ____ / /

/ / / / / / / `/ \

/ /_/ / / /_/ /___/ /_/ / /_/ /

\____/_/\__/_____/\__,_/_.___/

Thank you for installing GitLab!

3 配置GitLab URL

a:修改主配置文件:/etc/gitlab/gitlab.rb,修改external_url 的地址为:http://IP

[root@git ~]# vim /etc/gitlab/gitlab.rb

...

external_url 'http://192.168.0.110'

b:修改完主配置文件后,使用gitlab-ctl reconfigure重新配置gitlab使配置生效

[root@git ~]# gitlab-ctl reconfigure

提示:gitlab-ctl reconfigure一般修改完主配置文件/etc/gitlab/gitlab.rb,需要执行此命令

c:启动GitLab

[root@git ~]# gitlab-ctl start

d:查看GitLab服务状态

[root@git ~]# gitlab-ctl status

4 GitLab常用组件

  • nginx #静态Web服务器

  • gitlab-shell #用于处理Git命令

  • gitlab-workhorse #轻量级的反向代理服务器

  • logrotate #日志文件管理工具

  • postgresql #数据库

  • redis #缓存数据库

  • sidekiq #用于在后台执行队列任务(异步执行)

  • unicorn #GitLab Rails应用是托管在这个服务器上面的

5 GitLab服务参数

常用参数如下:

  • /opt/gitlab #应用代码和相应的依赖程序

  • /etc/gitlab #配置文件目录

  • /etc/gitlab/gitlab.rb #gitlab配置文件

  • /var/log/gitlab #gitlab各个组件产生的日志

  • /var/opt/gitlab/git-data/repositories #库默认存储目录

  • /var/opt/gitlab/backups/ #备份文件生成的目录

  • /var/opt/gitlab/gitlab-rails/etc/unicorn.rb #unicorn配置文件

  • /var/opt/gitlab/nginx/conf/gitlab-http.conf #nginx配置文件


6 GitLab常用命令

  • gitlab-ctl start #启动全部服务(也可指定单个服务)

  • gitlab-ctl restart #重启全部服务(也可指定单个服务)

  • gitlab-ctl stop #停止全部服务(也可指定单个服务)

  • gitlab-ctl reconfigure #使配置文件生效(修改主配置文件后使用)

  • gitlab-ctl show-config #验证配置文件

  • gitlab-ctl uninstall #卸载gitlab(保留数据)

  • gitlab-ctl cleanse #删除所有数据,从新开始

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

0
  1. 支付宝打赏

    qrcode alipay
  2. 微信打赏

    qrcode weixin

评论区