Sha256: 8bd0da2aa408b553309069344af2e1ee8e88c9d9a35dab9666fb8054e9327303

Contents?: true

Size: 519 Bytes

Versions: 1

Compression:

Stored size: 519 Bytes

Contents

# -*- mode: ruby -*-
require 'base64'

Populus.config do
  set :slack_webhook, "https://hooks.slack.com/services/XXXXXX"
end

Populus.watch :event, name: "sample" do
  cond {|data| data.any?{|d| d.has_key?('Payload')} }
  runs do |data|
    event = data.find{|d| d.has_key?('Payload')}
    Populus.logger.info "From populus!!!"
    Populus.logger.info Base64.decode64(event['Payload'])

    notify_to_slack("Hello!!!\nConsul event payload:\n>>> `#{event.inspect}`", channel: '#bot_test', username: "Populus")
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
populus-0.0.3 examples/echo.popl