安裝 hubot

因為 yeoman, 現在安裝 hubot 真的是超簡單的。

$ mkdir hubot
$ cd hubot
$ yo hubot --adapter hipchat

然後寫個 upstart file, /etc/init/hubot.conf 就解決了

description "Hubot"  
author "tzangms <[email protected]>"

start on filesystem or runlevel [2345]  
stop on runlevel [!2345]

# Path to Hubot installation
env HUBOT_DIR='/home/ubuntu/hubot/'  
env HUBOT='bin/hubot'  
env ADAPTER='hipchat'  
env HUBOT_USER='ubuntu'  
env PORT='5555'

env HUBOT_HIPCHAT_JID=<hubot_jid>  
env HUBOT_HIPCHAT_NAME=<hubot_name>  
env HUBOT_HIPCHAT_PASSWORD=<hubot_password>

# Keep the process alive, limit to 5 restarts in 60s
respawn  
respawn limit 5 60

exec start-stop-daemon --start --chuid ${HUBOT_USER} --chdir ${HUBOT_DIR} \  
    --exec ${HUBOT_DIR}${HUBOT} -- --name ${HUBOT_USER} --adapter ${ADAPTER}

最後執行下列指令就可以收工!

start hubot  

tzangms

Read more posts by this author.

Subscribe to Oceanic / 海海人生

Get the latest posts delivered right to your inbox.

or subscribe via RSS with Feedly!