module SozoMagento2::Slack

Slack message template

Public Instance Methods

message_hash() click to toggle source

Slack message template @return [String] the template hash

# File lib/capistrano/sozo_magento2/slack.rb, line 11
def message_hash
    {
        "channel" => fetch(:slack_channel), 
        "username" => "SOZO Deploy Bot", 
        "icon_emoji" => ":satellite:", 
        "color" => "good", 
        "text" => "#{fetch(:url)} Deployment Process Begun",
        "blocks" => [
            {
                "type" => "header", 
                "text" => {
                    "type" => "plain_text", 
                    "text" => "Deployment Process Begun"
                }
            }, 
            {
                "type" => "divider"
            }, 
            { 
                "type" => "section", 
                "text" => {
                    "type" => "mrkdwn", 
                    "text" => "#{fetch(:url)} is being Deployed"
                }, 
                "accessory" => {
                    "type" => "button", 
                    "style" => "primary", 
                    "text" => {
                        "type" => "plain_text", 
                        "text" => "Visit Site", 
                        "emoji" => true
                    },
                    "value" => "click_me_123", 
                    "url" => fetch(:url), 
                    "action_id" => "button-action"
                }
            }, 
            {
                "type" => "section", 
                "fields" => [
                    {
                        "type" => "mrkdwn", 
                        "text" => "*Branch:*\n#{fetch(:branch)}"
                    }, 
                    {
                        "type" => "mrkdwn", 
                        "text" => "*Developer:*\n#{fetch(:local_user)}"
                    }, 
                    {
                        "type" => "mrkdwn", 
                        "text" => "*Environment:*\n#{fetch(:environment)}"
                    }
                ]
            }
        ]
    }
end