环境
- 系统:centos7
- 内核:3.10.0-327.36.1.el7.x86_64
- IP:192.168.1.80
- Gitlab:8.14
解决依赖
1 | sudo yum install curl policycoreutils openssh-server openssh-clients |
添加gitlab源
国内用户可以使用清华大学的镜像站,加快下载速度
1 | tee >> /etc/yum.repos.d/gitlab.repo << EOF |
安装gitlab
1 | sudo yum makecache |
配置启动gitlab
1 | sudo gitlab-ctl reconfigure |
配置邮箱
这里以QQ企业邮箱为例
QQ exmail (腾讯企业邮箱)
编辑 1
2
gitlab_rails[‘smtp_enable’] = true
gitlab_rails[‘smtp_address’] = “smtp.exmail.qq.com”
gitlab_rails[‘smtp_port’] = 465
gitlab_rails[‘smtp_user_name’] = “xxxx@xx.com“
gitlab_rails[‘smtp_password’] = “password”
gitlab_rails[‘smtp_authentication’] = “login”
gitlab_rails[‘smtp_enable_starttls_auto’] = true
gitlab_rails[‘smtp_tls’] = true
gitlab_rails[‘gitlab_email_from’] = 'xxxx@xx.com‘1
2
3
重新加载配置并重启
sudo gitlab-ctl reconfigure1
2
3
4
5
6
7
8
9
# 备份
## 备份数据文件
默认数据备份目录是/var/opt/gitlab/backups,手动创建备份文件:
Omnibus 方式安装使用以下命令备份
sudo gitlab-rake gitlab:backup:create1
2
每天2点执行备份
0 2 * /opt/gitlab/bin/gitlab-rake gitlab:backup:create CRON=11
2
# 备份配置文件
sudo sh -c ‘umask 0077; tar -cf /var/opt/gitlab/backups/$(date “+etc-gitlab-%s.tar”) -C / etc/gitlab’1
2
每天2点执行备份
0 2 * sudo sh -c ‘umask 0077; tar -cf /var/opt/gitlab/backups/$(date “+etc-gitlab-%s.tar”) -C / etc/gitlab’`
参考
https://about.gitlab.com/downloads/#centos7
https://mirror.tuna.tsinghua.edu.cn/help/gitlab-ce/
https://docs.gitlab.com/omnibus/settings/smtp.html#qq-exmail
https://doc.gitlab.cc/omnibus/settings/backups.html