Vagrantのboxをアップデートしたりする

ひさしぶりにvagrantでubuntu環境を整えました

$ vagrant box list
ubuntu/trusty64

でいままで追加したboxを確認
一度追加したものだと2回目からはダウンロード済なので早いです

ubuntu/trusty64を追加します

$ vagrant init ubuntu/trusty64

でVagrantfileにubuntu/trusty64がセットされ作成されます
Vagrantfileのネットワーク設定などを変更して

起動

$ vagrant up

==> default: A newer version of the box 'ubuntu/trusty64' is available! You currently
==> default: have version '14.04'. The latest is version '20150512.0.0'. Run
==> default: `vagrant box update` to update.

と途中で言われたのでやり直す

boxをアップデート
$ vagrant box update

起動
$ vagrant reload

でできました

もう使わないboxは
$ vagrant box remote boxname
で消してディスク容量をあけておきました

hubotでscriptを作ってみる

hubot scriptを作ってみました

coffee scriptを

hubotディレクトリ/scripts/

の下に *.coffee
と保存をすれば勝手に読み込んでくれます

$ vim scripts/my.coffee

module.exports = (robot) ->

  robot.hear /おはよう/i, (msg) ->
    msg.send "Good Morning"

hubot-goodmorning

ちゃんと反応してくれます
robot.hearだと文字に反応します

hubot/scripting.md at master · github/hubot
を読むとよさそうです

hubotをSlackのデフォルト以外のチャンネルに参加させる

centosでhubotとslackを連携させてみた | bgbgbg
でslackとhubotを連携させましたが、#general以外のチャンネルに参加できない..

hubot-config

普通にinviteしてあげたら違うチャンネルに参加できるようです

参加させたいチャンネルで
/invite hubot
としてあげたら

hubot-invite

参加出来ました
slackの使い方を覚えたほうがよさそうです