LoginSignup
17
17

More than 5 years have passed since last update.

slackと連携するhubotをherokuで動かす

Posted at

簡易メモです

参考

http://nanapi.co.jp/blog/2014/06/04/slack_with_hubot/
https://github.com/tinyspeck/hubot-slack

1.hubotのインストール

brew install node redis
redis-server &
npm install -g hubot coffee-script
hubot --create sample-bot # sample-botは任意

2.hubotのslackアダプタをインストール

npm install hubot-slack --save

3.Procfileを編集

web: bin/hubot --adapter slack

4.herokuにデプロイ

heroku create sample-bot # sample-botは任意。
git push heroku master
heroku addons:add rediscloud
heroku ps:scale web=1

5.slackでhubotを有効化

  • こちらからhubotを有効化
  • HUBOT_SLACK_TOKEN、HUBOT_SLACK_TEAMを控える
  • Hubot URLにherokuのURLを指定

6.herokuのconfigを変更

heroku config:add HEROKU_URL=http://sample-bot.herokuapp.com # herokuのURL
heroku config:add HUBOT_SLACK_TOKEN=**************** # 5で控えたトークン
heroku config:add HUBOT_SLACK_TEAM=****** # 5で控えたチーム名
heroku config:add HUBOT_SLACK_BOTNAME=sample-bot # sample-botは任意。bot名
17
17
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
17
17