RPM包方式离线部署gitlab

下载安装包

  • 要求:可以联网,系统及版本与目标服务器一致。
  • 配置gitlab yum仓库
curl -s https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
  • 新建包存放目录
mkdir /root/gitlab
  • 下载gitlab及相关安装包
yum -y install gitlab-ce --downloadonly --downloaddir /root/gitlab/
  • 打包下载到本地
tar czvf gitlab.tar.gz gitlab/

安装部署

  • 上传到内网服务器,并解压
tar xzvf gitlab.tar.gz
  • 安装
cd gitlab
rpm -ivh *.rpm --force --nodeps
或
yum install -y *.rpm


#查看安装文件相关位置:rpm -ql gitlab-ce
#配置文件路径:/etc/gitlab/gitlab.rb
#程序路径:/opt/gitlab/
  • 部署
#修改配置文件中的访问地址
vim /etc/gitlab/gitlab.rb


external_url 'http://gitlab.example.com'
改为:
external_url 'http://192.168.199.128'
  • 应用配置
gitlab-ctl reconfigure
  • 启动
gitlab-ctl start
gitlab-ctl status
  • 访问页面
#账号:root
#查看初始页面登录密码
[root@cloud ~]# grep 'Password:' /etc/gitlab/initial_root_password
Password: G+Q1k3vqirzc7ywzeNZVo5MjIVHcLya1NqHA1RbWhmw=
  • 访问页面:http://192.168.199.128
  • 定时备份
编写备份脚本,结合crontab实施自动定时备份,比如每天0点、6点、12点、18点各备份一次
[root@code-server backups]# pwd
/var/opt/gitlab/backups/
[root@code-server backups]# vim gitlab_backup.sh
#!/bin/bash
/usr/bin/gitlab-rake gitlab:backup:create CRON=1
 
注意:环境变量CRON=1的作用是如果没有任何错误发生时, 抑制备份脚本的所有进度输出
 
[root@code-server backups]# crontab -l
0 0,6,12,18 * * * /bin/bash -x /data/gitlab/backups/gitlab_backup.sh > /dev/null 2>&1

分享、在看与点赞

只要你点,我们就是胖友

来自: RPM包方式离线部署gitlabicon-default.png?t=N7T8https://mp.weixin.qq.com/s?__biz=Mzk0NTQ3OTk3MQ==&mid=2247485582&idx=1&sn=c340456af4ad8cd81b5127404402a076&chksm=c31580c2f46209d4933b84672c803044f768d7dfdc2a8e0af1b9748055ed94d7aac2f04240ef&token=355315523&lang=zh_CN#rd

  • 7
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Linux技术宅

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值