LoginSignup
8
8

More than 5 years have passed since last update.

hubotをvagrant上で動かす

Posted at

CentOSのボックスを取得する

$ mkdir vagrant_hubot 
$ cd vagrant_hubot  
$ vagrant box add centos65 http://www.lyricalsoftware.com/downloads/centos65.box

Node.js, Redis, CoffeeScript, Hubotをインストール

#!/usr/bin/env bash

echo "Adding epel repository..."
sudo  rpm -ivh http://ftp.jaist.ac.jp/pub/Linux/Fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm >/dev/null 2>&1

echo "Installing node.js and Redis..."
sudo yum install -y nodejs npm redis

echo "Starting Redis..."
sudo /etc/init.d/redis start

echo "Setting Redis auto start..."
sudo chkconfig redis on

echo "Installing CoffeeScript and Hubot..."
sudo npm install -g coffee-script hubot

echo "Installing Hipchat plugin..."
sudo yum install -y libicu-devel
npm install hubot-hipchat --save

echo "Installing forever package"
sudo npm install forever -g

echo "Installing misawa..."
npm install hubot-misawa --save

echo "Finish!!"

Hubotディレクトリの作成

$ hubot --create mybot
$ cd mybot
$ npm install

HipChat用の環境変数をセット

#!/bin/sh
 
npm install
export PATH="node_modules/.bin:node_modules/hubot/node_modules/.bin:$PATH"
# Admin権限のあるAPIトークン
export HUBOT_HIPCHAT_TOKEN="Admin API Token"
# hubotユーザのJID
export HUBOT_HIPCHAT_JID="hubot JID"
# hubotユーザのパスワード
export HUBOT_HIPCHAT_PASSWORD="hubot password"
# ルームID
export HUBOT_HIPCHAT_ROOMS="your room"
# hubotはデフォルトで8080を使うが、既に使われている場合は適当に設定
# export PORT=9999
 
exec node_modules/.bin/hubot "$@"

HipChatと連携してHubotを起動

bin/hubot -a hipchat

misawa

"hubot-misawa" を external-scripts.json に追加
Reboot Hubot
8
8
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
8
8