gitlab-ce 安装、汉化与阿里邮箱配置(注意是CE)
环境准备
yum install curl openssh-server openssh-clients postfix cronie policycoreutils-python –y
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash
yum install -y gitlab-ce
汉化
git clone https://gitlab.com/xhang/gitlab.git
下载的文件覆盖安装的文件
\cp * /opt/gitlab/embedded/service/gitlab-rails/ -rf
邮箱配置
[root@gitlab gitlab]# cat /etc/gitlab/gitlab.rb |grep -v '#'|grep -v '^$'
external_url 'http://192.168.106.117'
gitlab_rails['gitlab_email_enabled'] = true
gitlab_rails['gitlab_email_from'] = '****@***.com'
gitlab_rails['gitlab_email_display_name'] = 'gitlab'
git_data_dirs({
"default" => {
"path" => "/home/gitlab_data"
}
})
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.mxhichina.com"
gitlab_rails['smtp_port'] = 465
gitlab_rails['smtp_user_name'] = "******"
gitlab_rails['smtp_password'] = "******"
gitlab_rails['smtp_domain'] = "*******"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = true
注意
gitlab_rails['gitlab_email_from']的名称要与发送帐户名称一至。
邮箱测试是否成功
登录gitlab-rails console
Notify.test_email('net2817@126.com','test',' ').deliver_now
gitlab-ctl stop
gitlab-ctl reconfigure
gitlab-ctl start
备份
[root@gitlab gitlab]# crontab -l
0 2 * * * /opt/gitlab/bin/gitlab-rake gitlab:backup:create