Redmineの通知をslackに連携させる方法
Redmineの通知をslackで受け取れるようにしたいと思います。
方法はslackアプリでincoming webhookを利用します。
Redmine側でプラグインを追加する
下記コマンドをそのまま実行します。
# cd /var/lib/redmine/plugins/ # git clone https://github.com/sciyoshi/redmine-slack.git redmine_slack # bundle install # rake redmine:plugins:migrate RAILS_ENV=production # service httpd restart
4つ目のコマンドrake~を実行した場合下記のようなエラーが出た際の対処法
[root@150-95-146-239 plugins]# rake redmine:plugins:migrate RAILS_ENV=production (in /var/lib/redmine) rake aborted! Gem::LoadError: You have already activated rake 12.0.0, but your Gemfile requires rake 13.0.1. Prepending `bundle exec` to your command may solve this.
対処方法として、コマンドの頭にbundle execを追加してあげてください。
[root@150-95-146-239 plugins]# bundle exec rake redmine:plugins:migrate RAILS_ENV=production (in /var/lib/redmine) Migrating redmine_slack (Redmine Slack)... [root@150-95-146-239 plugins]#
slackアプリにてincoming webbookを追加する
slackのAppよりincoming webhookを検索し追加します。
追加するとブラウザへ飛ばされますのでslackに追加をします。
次に通知を行うチャンネルを選択します。
ここではredmineとします。
そしてIncoming webhookインテグレーションの追加を実行