上篇 - Git 之七 - Centos7 搭建 Gitlab 服务器
Gitlab 常规配置
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| # vim /etc/gitlab/gitlab.rb
unicorn['port'] = 9999
gitlab_rails['backup_path'] = "/var/opt/gitlab/backups"
gitlab_rails['smtp_enable'] = true gitlab_rails['smtp_address'] = "smtp.exmail.qq.com" gitlab_rails['smtp_port'] = 25 gitlab_rails['smtp_user_name'] = "huangdc@domain.com" gitlab_rails['smtp_password'] = "smtp password" gitlab_rails['smtp_authentication']= "plain" gitlab_rails['smtp_enable_starttls_auto']= true gitlab_rails['gitlab_email_from']= "huangdc@domain.com" gitlab_rails['gitlab_email_reply_to']= "noreply@domain.com"
gitlab_rails['gitlab_shell_ssh_port'] = 55725
# gitlab-ctl reconfigure
# gitlab-ctl restart
|
Gitlab 定时备份
1 2 3 4 5 6
| # crontab -e 0 2 * * * /usr/bin/gitlab-rake gitlab:backup:create CRON=1
# crontab -l
|
Gitlab 恢复备份
1 2 3 4 5 6 7 8 9 10 11 12 13
| # gitlab-ctl stop unicorn # gitlab-ctl stop sidekiq
# cd /var/opt/gitlab/backups
# gitlab-rake gitlab:backup:restore BACKUP=1547096290_2019_01_10_11.6.3
# gitlab-ctl start unicorn # gitlab-ctl start sidekiq
|