This provides an instruction to set up a hubot in Slack.
Prerequisites
- git
- node installed with nvm, which is used in
.env
- terraform,
brew install terraform
if brew is available. - heroku account and API key
- heorku toolbelt
- Slack account and a token for hubot
and, basically only works on MacOSX.
Create a file heroku.tfvars
email = "youraccount@gmail.com"
api_key = "aaaaaaaa-1111-bbbb-2222-cccccccccccc"
Let's say you already have a token of hubot for Slack, type like this.
$ VAR_FILE=heroku.tfvars \
SLACK_TOKEN=<your-token> \
SLACK_TEAM=<your-tema> \
SLACK_BOTNAME=<your-botname> make apply
heroku_app.default: Creating...
config_vars.#: "" => "1"
config_vars.0.HEROKU_URL: "" => "http://secret-island-8419.herokuapp.com"
config_vars.0.HUBOT_SLACK_BOTNAME: "" => "secret-island-8419"
...
Outputs:
heroku_app.default.git_url = git@heroku.com:secret-island-8419.git
SLACK_TOKEN is issued here, https://kii.slack.com/services/new/hubot
On the assumption you've already logged in heroku
$ . .env
$ make bot push
hubot --create bot
...
This will create a new git repository to be deployed onto heroku, and will push the repository, so it's deploy.
That's it.
Hey, call the bot on your team of Slack!
$ VAR_FILE=heroku.tfvars \
SLACK_TOKEN=<your-token> \
SLACK_TEAM=<your-tema> \
SLACK_BOTNAME=<your-botname> make destroy
...
$ make distclean
This cleans up all resources, local files and heroku instance.
You can start from the top.