GitLab安装
1.GitLab简介
GitLab 是一个用于仓库管理系统的开源项目。使用Git作为代码管理工具,并在此基础上搭建起来的web服务。可通过Web界面进行访问公开的或者私人项目。它拥有与Github类似的功能,能够浏览源代码,管理缺陷和注释。可以管理团队对仓库的访问,它非常易于浏览提交过的版本并提供一个文件历史库。团队成员可以利用内置的简单聊天程序(Wall)进行交流。它还提供一个代码片段收集功能可以轻松实现代码复用。
常用的网站:
国内镜像:https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/
安装环境:
1、 CentOS 6或者7
2、 2G内存(实验)生产(至少4G)
3、 安装包:gitlab-ce-10.0.6-ce
4、 禁用防火墙,关闭selinux
2.GitLab安装
1、安装依赖
sudo yum install curl policycoreutils openssh-server openssh-clients policycoreutils-python sudo systemctl enable sshd sudo systemctl start sshd
systemctl
enable
postfix && systemctl start postfix
2、获取rpm安装包
[root@node2 src]# cd /usr/local/src/ [root@node2 src]# wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-11.2.3-ce.0.el7.x86_64.rpm
3.安装
[root@node2 src]# rpm -ivh gitlab-ce-11.2.3-ce.0.el7.x86_64.rpm warning: gitlab-ce-10.0.6-ce.0.el7.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID f27eab47: NOKEY Preparing... ################################# [100%] Updating / installing... 1:gitlab-ce-10.0.6-ce.0.el7 ################################# [100%] It looks like GitLab has not been configured yet; skipping the upgrade script. *. *. *** *** ***** ***** .****** ******* ******** ******** ,,,,,,,,,***********,,,,,,,,, ,,,,,,,,,,,*********,,,,,,,,,,, .,,,,,,,,,,,*******,,,,,,,,,,,, ,,,,,,,,,*****,,,,,,,,,. ,,,,,,,****,,,,,, .,,,***,,,, ,*,. _______ __ __ __ / ____(_) /_/ / ____ _/ /_ / / __/ / __/ / / __ \`/ __ \ / /_/ / / /_/ /___/ /_/ / /_/ / \____/_/\__/_____/\__,_/_.___/ Thank you for installing GitLab! GitLab was unable to detect a valid hostname for your instance. Please configure a URL for your GitLab instance by setting `external_url` configuration in /etc/gitlab/gitlab.rb file. Then, you can start your GitLab instance by running the following command: sudo gitlab-ctl reconfigure For a comprehensive list of configuration options please see the Omnibus GitLab readme https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md
4.配置
修改配置文件:/etc/gitlab/gitlab.rb
修改external_url 的地址为:http://192.168.56.12
启用并修改git_data_dirs参数的path
git_data_dirs({
"default" => {
"path" => "/data/gitlab-data"
}
# 启用备份目录
gitlab_rails['manage_backup_path'] = true
gitlab_rails['backup_path'] = "/data/gitlab-data/backups"
gitlab_rails['backup_archive_permissions'] = 0644
gitlab_rails['backup_keep_time'] = 7776000 #保留90天
# 创建备份目录
mkdir -p /data/gitlab-data/backups
chmod -R 777 /data/gitlab-data/backups
修改完主配置文件后,使用gitlab-ctl reconfigure重新配置gitlab
如果一直夯住
执行
systemctl restart gitlab-runsvdir
5.启动
重新配置gitlba后,在浏览地址栏中输入http://192.168.56.12
配置root用户的密码,完成后进入系统:
至此我们的GitLab安装已经完成
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?