Sha256: 7a07dde24cb749486ca5cd54f5af480f8899723c19eb8b1678b868dfbd6df83e

Contents?: true

Size: 995 Bytes

Versions: 44

Compression:

Stored size: 995 Bytes

Contents

# frozen_string_literal: true

# This component sets up the MailHog (https://github.com/mailhog/MailHog)
# image with the proper configuration for SMTP email delivery from Gitlab

module Gitlab
  module QA
    module Component
      class MailHog < Base
        DOCKER_IMAGE = 'mailhog/mailhog'
        DOCKER_IMAGE_TAG = 'v1.0.0'

        def name
          @name ||= "mailhog"
        end

        def instance
          raise 'Please provide a block!' unless block_given?

          super
        end

        def start
          docker.run(image: image, tag: tag) do |command|
            command << '-d '
            command << "--name #{name}"
            command << "--net #{network}"
            command << "--hostname #{hostname}"
            command << "--publish 1025:1025"
            command << "--publish 8025:8025"
          end
        end

        def set_mailhog_hostname
          ::Gitlab::QA::Runtime::Env.mailhog_hostname = hostname
        end
      end
    end
  end
end

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
gitlab-qa-15.3.0 lib/gitlab/qa/component/mail_hog.rb
gitlab-qa-15.2.0 lib/gitlab/qa/component/mail_hog.rb
gitlab-qa-15.1.0 lib/gitlab/qa/component/mail_hog.rb
gitlab-qa-15.0.0 lib/gitlab/qa/component/mail_hog.rb
gitlab-qa-14.21.0 lib/gitlab/qa/component/mail_hog.rb
gitlab-qa-14.20.0 lib/gitlab/qa/component/mail_hog.rb
gitlab-qa-14.19.2 lib/gitlab/qa/component/mail_hog.rb
gitlab-qa-14.19.1 lib/gitlab/qa/component/mail_hog.rb
gitlab-qa-14.19.0 lib/gitlab/qa/component/mail_hog.rb
gitlab-qa-14.18.0 lib/gitlab/qa/component/mail_hog.rb
gitlab-qa-14.17.0 lib/gitlab/qa/component/mail_hog.rb
gitlab-qa-14.16.0 lib/gitlab/qa/component/mail_hog.rb
gitlab-qa-14.15.0 lib/gitlab/qa/component/mail_hog.rb
gitlab-qa-14.14.0 lib/gitlab/qa/component/mail_hog.rb
gitlab-qa-14.13.0 lib/gitlab/qa/component/mail_hog.rb
gitlab-qa-14.12.0 lib/gitlab/qa/component/mail_hog.rb
gitlab-qa-14.11.0 lib/gitlab/qa/component/mail_hog.rb
gitlab-qa-14.9.0 lib/gitlab/qa/component/mail_hog.rb
gitlab-qa-14.8.1 lib/gitlab/qa/component/mail_hog.rb
gitlab-qa-14.8.0 lib/gitlab/qa/component/mail_hog.rb