gitlab安装与邮件及域名配置

一、安装gitlab

  1. 安装gitlab yum 源:
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash 
  1. 通过yum安装gitlab:
sudo yum -y install gitlab-ee

二、配置邮件通知

  1. 修改配置文件vim /etc/gitlab/gitlab.rb,添加如下配置;
    找到【GitLab email server settings】,在其中添加下如配置:
# 以下为阿里云企业邮箱的配置
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.mxhichina.com"
gitlab_rails['smtp_port'] = 25
gitlab_rails['smtp_user_name'] = "***@emjwash.com"
gitlab_rails['smtp_password'] = "******"
gitlab_rails['smtp_domain'] = "emjwash.com"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['gitlab_email_from'] = '***@emjwash.com'
  1. 重启gitlab:/opt/gitlab/bin/gitlab-ctl reconfigure;

三、修改gitlab访问域名

  1. 编辑配置文件:vim /etc/gitlab/gitlab.rb;
# 修改http访问地址
external_url 'http://120.76.*.*:82' # 采用IP访问
external_url 'http://gitlab.****.com'  # 采用域名访问

# 修改ssh访问端口
gitlab_rails['gitlab_shell_ssh_port'] = 6022
  1. 重启gitlab:/opt/gitlab/bin/gitlab-ctl reconfigure;

你可能感兴趣的:(git,CI-持续集成)