srushti / goldberg

Goldberg is a lightweight CI server written in Ruby which worries about Bundler & RVM so that you don't have to.
Other
243 stars 29 forks source link

send an email to a distribution list when a build fails/succeeds #38

Closed professor closed 13 years ago

professor commented 13 years ago

This is a feature request

I'd like to configure goldberg.yml to use gmail to send out the "build failed" or "build succeeded" email. I would expect an email every time the build failed and one email when it started to succeed again.

achamian commented 13 years ago

@aakashd is already looking into it.

gja commented 13 years ago

shotgun. I'm trying to make a plugin structure for goldberg

gja commented 13 years ago

I added a after_build feature to the config.

It's just a matter of after_build Proc.new { |build, project| if (build.status == 'Failed' || (build.status == 'Success' && project.builds[1] == 'failed')) Pony.mail(:to => oeao, :from => ...) }

aakashd commented 13 years ago

@gja - The API that we are planning is as shown in attached gist https://gist.github.com/952006

Let me know what you think about it, and if you have a bandwidth to implement it.

professor commented 13 years ago

I'm biased by the way cruisecontrol.rb does this. In the system configuration, one can specify default configurations (ie from address). In the project configuration, one specifies the "to address". If a "to address" is present, then the default behavior would be email on failure and email on first successful after a failure. I would document how to override the default with more interesting behavior.

I'm traveling quite a bit in May, so I'm not able to contribute as much as I can in June.

Todd

rohitarondekar commented 13 years ago

What's the progress on this? I'm interested in writing a Campfire notifier so that Goldberg can notify a campfire room.

professor commented 13 years ago

It's not clear to me who is working on this feature right now.

aakashd commented 13 years ago

I have worked on this issue, and its already done.

The API is


Project.configure do |config|
  config.rake_task = 'ci'
  config.on_build_failure do |build,notification|
    notification.from('goldber@c42.in').to('aakashd@gmail.com').with_subject("Build #{build.id} for #{build.project.name} #{build.status}").send
  end
end

aakashd commented 13 years ago

@rohit I have added hooks for on_build_completion, on_failure, on_success & on_red_to_green; which you can use to hook the Campfire notifications.