Module: Capistrano::Grove

Defined in:
lib/capistrano-grove.rb,
lib/grove/capistrano.rb,
lib/capistrano-grove/version.rb

Defined Under Namespace

Classes: Client

Constant Summary collapse

VERSION =
"1.0.1"

Class Method Summary collapse

Class Method Details

.load_into(config) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/grove/capistrano.rb', line 7

def self.load_into(config)
  config.load do
    set :grove_channel_key, '' # the channel's API key
    set :grove_service, 'DeployBot' # the name of the service posting
    set :grove_icon_url, nil # url to the icon to use.
    set :grove_url, nil # the url you want to use for your bot

    # the message that gets posted.
    # set this before calling grove:notify to customize
    set(:grove_message) {
      "Successful deployment of #{ fetch(:application, 'application') }."
    }

    namespace :grove do

      desc "Notify the grove.io service."
      task :notify do
        g = Client.new(grove_channel_key,
          :service => grove_service,
          :icon_url => grove_icon_url,
          :url => grove_url
        )

        unless g.notify(grove_message)
          # error
          logger.important "Failed to send notification to grove.io"
        end
      end
    end
  end
end