Skip to content

Gitlab CI Omnibus - SMTP Configuration fails

Hi there

I installed Gitlab CI (only CI!) on a server using the omnibus package (7.4.3-omnibus.5.1.0.ci-1). Now I'm trying to set up SMTP but when I access my Gitlab CI I get the following error in sidekiq's log:

2014-11-20_10:41:40.41557 uninitialized constant Gitlab
2014-11-20_10:41:40.41568 /opt/gitlab/embedded/service/gitlab-ci/config/initializers/smtp_settings.rb:6:in `<top (required)>'
...

I checked the generated smtp_settings.rb and found the following:

# This file is managed by gitlab-ctl. Manual changes will be
# erased! To change the contents below, edit /etc/gitlab/gitlab.rb
# and run `sudo gitlab-ctl reconfigure`.

if Rails.env.production?
  Gitlab::Application.config.action_mailer.delivery_method = :smtp

  ActionMailer::Base.smtp_settings = {
    authentication: :login,
  }
end

Now if I change Gitlab:: to GitlabCi::, Gitlab CI starts (but sends no emails). Is that a bug or am I doing something wrong?

My /etc/gitlab/gitlab.rb looks as follows:

ci_external_url 'https://gitlab-ci.myserver.com'

# Tell GitLab CI to integrate with gitlab.example.com
gitlab_ci['gitlab_server_urls'] = ['https://gitlab.myserver.com']

gitlab_ci['smtp_enable'] = true
gitlab_ci['smtp_address'] = 'smtp.myserver.com'
gitlab_ci['smtp_port'] = 587
gitlab_ci['smtp_user_name'] = 'myusername'
gitlab_ci['smtp_password'] = 'mypass'
gitlab_ci['smtp_domain'] = 'gitlab-ci.myserver.com'
gitlab_ci['smtp_authentication'] = 'login'
gitlab_ci['smtp_enable_starttls_auto'] = true
gitlab_ci['gitlab_ci_email_from'] = 'gitlab-ci@gitlab.myserver.com'

# Shut down GitLab services on the CI server
unicorn['enable'] = false
sidekiq['enable'] = false