Sha256: 3a8966d2e713f5b398ffc153738e35de2d932a4eb13a9c04c47e2f6c65585249

Contents?: true

Size: 1.08 KB

Versions: 43

Compression:

Stored size: 1.08 KB

Contents

module Reporter
  class Mail
    attr_accessor :deploy_email_from
    attr_accessor :deploy_email_to
    attr_accessor :application_name
    attr_accessor :module_name
    attr_accessor :environment
    attr_accessor :version
    attr_accessor :worker

    def send(options={})
      Helper.validates_presence_of deploy_email_from, "deploy_email_from not set"
      Helper.validates_presence_of deploy_email_to, "deploy_email_to not set"
      Helper.validates_presence_of application_name, "application_name not set"
      Helper.validates_presence_of module_name, "module_name not set"
      Helper.validates_presence_of environment, "environment not set"

      status = options[:status] || "done"
      message = options[:message] || ""

      worker.sendmail(:from => "#{deploy_email_from}", \
          :to => "#{deploy_email_to}", \
           :subject => "JENKINS: #{module_name} #{environment} #{application_name} #{status}", \
           :body => "Module: #{module_name}\nEnvironment:  #{environment}\nJob: #{application_name}\nVersion: #{version}\n#{status}.\n\n#{message}" )
    end
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
depengine-3.0.12 lib/depengine/reporter/mail.rb
depengine-3.0.11 lib/depengine/reporter/mail.rb
depengine-3.0.10 lib/depengine/reporter/mail.rb
depengine-3.0.9 lib/depengine/reporter/mail.rb
depengine-3.0.8 lib/depengine/reporter/mail.rb
depengine-3.0.7 lib/depengine/reporter/mail.rb
depengine-3.0.6 lib/depengine/reporter/mail.rb
depengine-3.0.5 lib/depengine/reporter/mail.rb
depengine-3.0.4 lib/depengine/reporter/mail.rb
depengine-3.0.3 lib/depengine/reporter/mail.rb
depengine-3.0.2 lib/depengine/reporter/mail.rb
depengine-3.0.1 lib/depengine/reporter/mail.rb
depengine-3.0.0 lib/depengine/reporter/mail.rb
depengine-0.0.31 lib/depengine/reporter/mail.rb
depengine-0.0.30 lib/depengine/reporter/mail.rb
depengine-0.0.29 lib/depengine/reporter/mail.rb
depengine-0.0.28 lib/depengine/reporter/mail.rb
depengine-0.0.27 lib/depengine/reporter/mail.rb
depengine-0.0.26 lib/depengine/reporter/mail.rb
depengine-0.0.25 lib/depengine/reporter/mail.rb