読者です 読者をやめる 読者になる 読者になる

なみひらブログ

学んだことを日々記録する。~ since 2012/06/24 ~

Hubot構築@CentOS 6.5【その2】

Hubot構築@CentOS 6.5【その1】 - なみひらブログのつづき。

Redisの依存を削除する

HUbotはデフォルトでDB「Redis」を使うように設定されているので、その依存を解除しておきます。(あとで戻すけど。)

[namihira@xx.xx.xx.xx]~/hubot/hubot/src/templates% cat hubot-scripts.json
["redis-brain.coffee", "shipit.coffee"]
[namihira@xx.xx.xx.xx]~/hubot/hubot/src/templates% vi hubot-scripts.json
[namihira@xx.xx.xx.xx]~/hubot/hubot/src/templates% cat hubot-scripts.json
["shipit.coffee"]

ポートを設定する

ポートを環境変数で設定しないと怒られるので、設定します。(Hubotは環境変数設定が多いので、あとで起動スクリプトを用意します。)

[namihira@xx.xx.xx.xx]~/hubot/hubot% node_modules/coffee-script/bin/coffee bin/hubot
Hubot> [Sun Jan 12 2014 18:54:58 GMT+0900 (JST)] ERROR Error: listen EADDRINUSE
  at errnoException (net.js:901:11)
  at Server._listen2 (net.js:1039:14)
  at listen (net.js:1061:10)
  at net.js:1135:9
  at dns.js:72:18
  at process._tickCallback (node.js:415:13)
[namihira@xx.xx.xx.xx]~/hubot% export PORT=9999

いざ!Hubot起動!

CoffeeScriptをインストールしていないので、Hubotに格納されているCoffeeScriptで実行します。
(※CoffeeScriptをnpmで入れようとしたらエラーになったのは内緒。残課題。)

[namihira@xx.xx.xx.xx]~/hubot/hubot% pwd
/home/namihira/hubot/hubot
[namihira@xx.xx.xx.xx]~/hubot/hubot% node_modules/coffee-script/bin/coffee bin/hubot
Hubot> [Sun Jan 12 2014 18:52:18 GMT+0900 (JST)] WARNING The HUBOT_AUTH_ADMIN environment variable not set
Hubot> hubot help
Hubot> Events:
debug - {user: <user object to send message to>}
Hubot <user> doesn't have <role> role - Removes a role from a user
Hubot <user> has <role> role - Assigns a role to a user
Hubot <user> is a badass guitarist - assign a role to a user
Hubot <user> is not a badass guitarist - remove a role from a user
Hubot animate me <query> - The same thing as `image me`, except adds a few parameters to try to return an animated GIF instead.
Hubot convert me <expression> to <units> - Convert expression to given units.
Hubot die - End Hubot process
Hubot echo <text> - Reply back with <text>
Hubot fake event <event> - Triggers the <event> event for debugging reasons
Hubot help - Displays all of the help commands that Hubot knows about.
Hubot help <query> - Displays all help commands that match <query>.
Hubot image me <query> - The Original. Queries Google Images for <query> and returns a random top result.
Hubot map me <query> - Returns a map view of the area returned by `query`.
Hubot math me <expression> - Calculate the given expression.
Hubot mustache me <query> - Searches Google Images for the specified query and mustaches it.
Hubot mustache me <url> - Adds a mustache to the specified URL.
Hubot ping - Reply with pong
Hubot pug bomb N - get N pugs
Hubot pug me - Receive a pug
Hubot show storage - Display the contents that are persisted in the brain
Hubot show users - Display all users that Hubot knows about
Hubot the rules - Make sure Hubot still knows the rules.
Hubot time - Reply with current time
Hubot translate me <phrase> - Searches for a translation for the <phrase> and then prints that bad boy out.
Hubot translate me from <source> into <target> <phrase> - Translates <phrase> from <source> into <target>. Both <source> and <target> are optional
Hubot what role does <user> have - Find out what roles are assigned to a specific user
Hubot who has admin role - Find out who's an admin and can assign roles
Hubot who is <user> - see what roles a user has
Hubot youtube me <query> - Searches YouTube for the query and returns the video embed link.
Hubot>

できた\(^o^)/