gitlab搭建

社区版安装

建议4G内存

  1. 安装并配置必须的依赖
sudo yum install -y curl policycoreutils-python openssh-server
sudo systemctl enable sshd
sudo systemctl start sshd
sudo firewall-cmd --permanent --add-service=http
sudo systemctl reload firewalld

  1. 安装Postfix以发送通知电子邮件。如果要使用其他解决方案发送电子邮件,请跳过此步骤并在安装GitLab后配置外部SMTP服务器。
sudo yum install postfix
sudo systemctl enable postfix
sudo systemctl start postfix

如果启动报错,修改 /etc/postfix/main.cf的设置

inet_protocols = ipv4
inet_interfaces = all
  1. 添加社区版仓库并安装
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
sudo EXTERNAL_URL="http://gitlab.example.com" yum install -y gitlab-ce

  1. 配置gitlib

编辑vim /etc/gitlab/gitlab.rb

external_url 'http://47.98.163.84:10000'

按照推荐自动配置,并启动

gitlab-ctl reconfigure

后面修改端口需要修改下面的文件

/var/opt/gitlab/gitlab-rails/etc/gitlab.yml
/var/opt/gitlab/nginx/conf/gitlab-http.conf
  1. 关闭与启动
  • 关闭 gitlab-ctl stop
  • 启动 gitlab-ctl start
  1. 备份与恢复
  • 备份 需要在启动状态下,备份目录:/var/opt/gitlab/backups/
gitlab-rake gitlab:backup:create
  • 恢复:
gitlab-ctl stop unicon
gitlab-ctl stop sideiq
gitlab-rake gitlab:backup:restore  BACKUP=1531674119_2018_07_16_11.0.3
gitlab-ctl start
posted @   头痛不头痛  阅读(26)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
历史上的今天:
2016-09-08 Samba服务
2016-09-08 Python学习笔记11—函数
点击右上角即可分享
微信分享提示
主题色彩