capistrano-slack icon indicating copy to clipboard operation
capistrano-slack copied to clipboard

Issue in receiving the notifications

Open AstmDesign opened this issue 6 years ago • 0 comments

Hello Guys, First I would like to thank you for you creating this amazing Gem, but I did all the steps in my code and from the terminal when stating deploy to the server I saw in the terminal slack:starting & slack:finished but actually didn't got the notification on slack !! so what is missing in my deploy.rb file?!! this is my deploy.rb credentials:

require 'capistrano/slack'

set :deployer do
  name = `git config user.name`.strip
  name = `whoami`.strip if name == ''
  name
end

set :slack_token, 'https://hooks.slack.com/services/............etc ' # comes from inbound webhook integration
set :slack_room, '#deploying' # room
set :slack_subdomain, 'astm' # if your subdomain is astm.slack.com
set :slack_emoji, ':shipit:' # ":rocket:"
set :slack_deploy_defaults, false
set :slack_application, "myApp"
set :slack_username, "Deploying on server"

namespace :slack do
  task :starting do
    slack_connect "#{fetch(:deployer)} *started* deploying to *#{fetch(:stage)}*. :rocket:"
  end

  task :finished do
    slack_connect "#{fetch(:deployer)} *finished* deploying to *#{fetch(:stage)}*. :star2:"
  end
end

before 'deploy:update_code', 'slack:starting'
after 'deploy:restart', 'slack:finished' 

And in my Gemfile I added & bundle install

group :development do
	# For Notifying slack
	gem 'capistrano-slack'
end

AstmDesign avatar Aug 14 '18 07:08 AstmDesign