send slack notification from command line
-
create Slack app and incoming webhook https://slack.com/intl/en-ru/help/articles/115005265063-Incoming-WebHooks-for-Slack?eu_nc=1
-
edit
./slack-notify.sh
change url and channel for Slack notifications:
url="<YOUR_SLACK_INCOMING_WEBHOOK>"
channel="#general" -
to
~/.bashrc
(or~/.zshrc
) add this line:
alias slack-notify='sh <PATH>/slack-notify.sh'
- try to send notification:
slack notify "header" "๐ค long text"
slack-notify "long job is done" "$(date)"