目 录CONTENT

文章目录

gitlab配置邮箱推送通知

懿曲折扇情
2022-08-03 / 0 评论 / 4 点赞 / 79 阅读 / 542 字 / 正在检测是否收录...
温馨提示:
本文最后更新于 2022-08-03,若内容或图片失效,请留言反馈。部分素材来自网络,若不小心影响到您的利益,请联系我们删除。
广告 广告

一、gitlab配置邮箱推送通知

起因:原本以为推送企业微信够了,结果领导意思推送邮箱更加直观,那么就有了下文。

二、配置步骤

gitlab官网----->邮件配置点这里呦

1.修改配置文件

vim /etc/gitlab/gitlab.rb

  81
  82 gitlab_rails['smtp_enable'] = true
  83 gitlab_rails['smtp_address'] = "smtp.126.com"
  84 gitlab_rails['smtp_port'] = 25
  85 gitlab_rails['smtp_user_name'] = "testops_jianshuai@126.com"
  86 gitlab_rails['smtp_password'] = "xxxxxxxxxxxxx授权码"
  87 gitlab_rails['smtp_domain'] = "126.com"
  88 gitlab_rails['smtp_authentication'] = "login"
  89 gitlab_rails['smtp_enable_starttls_auto'] = true
  90 gitlab_rails['smtp_tls'] = false
  91 gitlab_rails['smtp_pool'] = "testops_jianshuai@126.com"
  92
  93 ###! **Can be: 'none', 'peer', 'client_once', 'fail_if_no_peer_cert'**
  94 ###! Docs: http://api.rubyonrails.org/classes/ActionMailer/Base.html
  95 # gitlab_rails['smtp_openssl_verify_mode'] = 'none'
  96
  97 # gitlab_rails['smtp_ca_path'] = "/etc/ssl/certs"
  98 # gitlab_rails['smtp_ca_file'] = "/etc/ssl/certs/ca-certificates.crt"
  99
 100 ### Email Settings
 101
 102 # gitlab_rails['gitlab_email_enabled'] = true
 103
 104 ##! If your SMTP server does not like the default 'From: gitlab@gitlab.example.com'
 105 ##! can change the 'From' with this setting.
 106 gitlab_rails['gitlab_email_from'] = 'testops_jianshuai@126.com'
 107 # gitlab_rails['gitlab_email_display_name'] = 'Example'
 108 gitlab_rails['gitlab_email_reply_to'] = 'testops_jianshuai@126.com'
 109 # gitlab_rails['gitlab_email_subject_suffix'] = ''
 110 # gitlab_rails['gitlab_email_smime_enabled'] = false
 111 # gitlab_rails['gitlab_email_smime_key_file'] = '/etc/gitlab/ssl/gitlab_smime.key'
 112 # gitlab_rails['gitlab_email_smime_cert_file'] = '/etc/gitlab/ssl/gitlab_smime.crt'
 113 # gitlab_rails['gitlab_email_smime_ca_certs_file'] = '/etc/gitlab/ssl/gitlab_smime_cas.crt'
 114
 115 ### GitLab user privileges
 116 # gitlab_rails['gitlab_default_can_create_group'] = true
 117 # gitlab_rails['gitlab_username_changing_enabled'] = true

2.重新加载配置

gitlab-ctl reconfigure

3.调试是否配置成功

gitlab-rails console

image-1659536674401

Notify.test_email('1315202xxxx@163.com','Message Subject','Hello, kazihuo !').deliver_now

测试通过:

image-1659536033414

image-1659536050276

4.配置gitlab邮件推送事件

右上角头像setting>------Preference>----->Notification

image-1659536563487

5.选择自定义

image-1659536618404

6.选择事件选项

image-1659536656864

7.推送结果

image-1659536735448

8.直接点击View it on GitLab跳转

image-1659536996106

image-1659537541639

4

评论区