如何一步步轻松设置和安装 Linux 上的 GitLab,并完成汉化详细指南
gitlab 安装及汉化
GitLab简介:
GitLab是一个用于仓库管理系统的开源项目。使用Git作为代码管理工具,并在此基础上搭建起来的Web服务。可通过Web界面进行访问公开的或者私人项目。它拥有GitHub类似的功能,能够浏览源代码,管理缺陷和注释。可以管理团队对仓库的访问,它非常易于浏览提交过的版本并提供一个文件历史库。团队成员可以利用内置的简单聊天程序(Wall)进行交流。它还提供了一个代码片段收集功能可以轻松实现代码复用。
常用的网站:
官网:https://about.gitlab.com/
国内镜像:https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/
安装gitlab
安装环境:
(1)CentOS 6或者7 (此处使用7)
(2)2G内存(实验)生产(至少4G),不然会很卡
(3)安装包:gitlab-ce-13.7.3-ce.0.el7.x86_64.rpm
(4)禁用防火墙,关闭selinux
安装步骤:
1.安装依赖包
[root@git gitlab]# yum install -y curl policycoreutils-python openssh-server
2.进入https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/,找到自己需要的版本,下载软件包,通过rz命令上传文件,也可以通过命令进行下载
[root@git gitlab]# wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-13.7.3-ce.0.el7.x86_64.rpm
如果在页面下载好安装包,想通过rz命令进行上传,但rz提示 -bash: rz: 未找到命令,输入如下命令安装lrzsz,安装后即可使用rz命令
[root@git gitlab]# yum -y install lrzsz
3.安装gitlab
[root@git gitlab]# rpm -ivh gitlab-ce-13.7.3-ce.0.el7.x86_64.rpm
根据安装完成提示界面进行访问URL更改及重新加载配置文件 更改选项为自己的域名或者IP
4.编辑配置文件
[root@git gitlab]# vi /etc/gitlab/gitlab.rb
5.改为自己的IP地址
external_url= 'http://192.168.1.221'
6.重新加载配置文件
[root@git gitlab]# gitlab-ctl reconfigure
7.重装完成访问http://192.168.1.221,会首先叫更改密码(root用户),改完后登录。如下界面:
汉化
1、下载汉化补丁
[root@git gitlab]# git clone https://gitlab.com/xhang/gitlab.git
[root@git gitlab]# cd gitlab
2、查看全部分支版本
[root@git gitlab]# git branch -a
3、对比版本、生成补丁包
[root@git gitlab]# git diff remotes/origin/10-2-stable remotes/origin/10-2-stable-zh > /tmp/10.2.2-zh.diff
4、停止服务器
[root@git gitlab]# gitlab-ctl stop
5、打补丁
[root@git gitlab]# patch -d /opt/gitlab/embedded/service/gitlab-rails -p1 < /tmp/10.2.2-zh.diff
6、启动和重新配置
[root@git gitlab]# gitlab-ctl start
[root@git gitlab]# gitlab-ctl reconfigure
说明:这里如果使用的同样是gitlab10.2.2,下载汉化较慢的话,可以直接在这里下载10.2.2-zh.diff。提取码:5mhz
汉化完成后再次刷新页面如下
Gitlab相关操作及说明:
/etc/gitlab/gitlab.rb #gitlab配置文件
/opt/gitlab #gitlab的程序安装目录
/var/opt/gitlab #gitlab目录数据目录
/var/opt/gitlab/git-data #存放仓库数据
gitlab-ctl reconfigure #重新加载配置
gitlab-ctl status #查看当前gitlab所有服务运行状态
gitlab-ctl stop #停止gitlab服务
gitlab-ctl stop nginx #单独停止某个服务
gitlab-ctl tail #查看所有服务的日志
Gitlab的服务构成:
nginx: 静态web服务器
gitlab-workhorse 轻量级反向代理服务器
logrotate 日志文件管理工具
postgresql 数据库
redis 缓存数据库
sidekiq 用于在后台执行队列任务(异步执行)
参考文献:https://www.cnblogs.com/liujunjun/p/12345787.html
推荐阅读
-
如何一步步轻松设置和安装 Linux 上的 GitLab,并完成汉化详细指南
-
如何轻松使用JMeter进行HTTP接口测试 - 一步步教你设置线程组、 cookie、默认值与Sampler,加上响应断言和监听器,打造基础测试案例。针对复杂情况,将子系统和流程测试分类组织,确保数据一致性。同时,别忘了感谢阅读,给新手提供实战学习资源与全套测试指南,助你轻松踏上自动化测试之路! - 在"测试计划"点击右键,添加"线程组"并设定初始"线程数"和"循环次数" - 配置"HTTP Cookie管理器"与"Http请求默认值",输入目标系统信息,如域名、端口、协议等,让所有相关Sampler共享这些默认设置 - 在线程组内增加"HTTP Request"的Sampler,并填入接口详情,比如路径、请求方法及参数 - 添加"响应断言"检查接口返回结果,通过正则表达式验证预期结果 - 安装监听器,实时查看测试执行状况 - 如需处理流程性接口,请依次添加多个相关Sampler,关联前后请求间的上下文数据 特别提示:为了帮助大家避免学习中的曲折,我们准备了详尽的视频和文档资料库,无论你是软件测试的新手还是老司机,都能从中找到所需的全方位支持。只需点击下方链接加入我们的学习交流社群,就能立刻获取这份珍贵的学习宝藏!再次感谢您的耐心阅读,愿它成为您前行路上的一大助力!