hubot-jellyfish
A Jellyfish adapter for Hubot
Developing
Setup
-
Clone this repo and install the npm dependencies:
git clone git@github.com:product-os/hubot-jellyfish.git cd hubot-jellyfish && npm i
-
Create a local hubot instance:
npm i -g yo generator-hubot mkdir myhubot && cd myhubot yo hubot
Follow the instructions. When prompted to specify an adapter, enter
jellyfish
. -
Use
npm link
to link thehubot-jellyfish
adapter to the hubot instance:cd myhubot npm link ../hubot-jellyfish
-
Edit the
package.json
file inmyhubot
to add thehubot-jellyfish
npm package as a dependency (set the version to the current version of this package):"dependencies": { ... "hubot-jellyfish": "^0.0.1" }
-
Configure environment variables
The following environment variables must be defined before running hubot locally:
-
HUBOT_JELLYFISH_API_URL
(e.g.http://localhost:8000
for local development) -
HUBOT_JELLYFISH_TOKEN
(An api token for authenticating with Jellyfish)
The easiest way to do this is to add a
.env
to yourmyhubot
folder and specify the environment variables in that file. -
-
Use
npm link
to link to thehubot
package in themyhubot
project (otherise the localnode_modules/hubot
package is used and the adapter doesn't communicate with the same hubot asmyhubot
is using!)cd hubot-jellyfish npm link ../myhubot/node_modules/hubot
-
Run Hubot!
cd myhubot bin/hubot -n hubot -a jellyfish
Testing
To run the unit tests you have to unlink hubot from hubot-jellyfish:
cd hubot-jellyfish
npm unlink ../myhubot/node_modules/hubot
npm install
Then you can run the tests:
npm run test