Search code examples
docker-composehubotrocket.chat

hubot rocketchat adapter does not work


I installed rocket.chat and hubot on a Digitalocean droplet (Ubuntu) and now I am trying to make hubot talk:

when I run:

hubot -a rocketchat

I get:

ERROR Cannot load adapter rocketchat - Error: Cannot find module 'hubot-rocketchat'

What can be the reason of that?

Here is my docker-compose.yml:

db:
  image: mongo
  volumes:
    - ./data/runtime/db:/data/db
    - ./data/dump:/dump
  command: mongod --smallfiles

rocketchat:
  image: rocketchat/rocket.chat:latest
  environment:
    - MONGO_URL=mongodb://db:27017/rocketchat
    - ROOT_URL=https://xxxxxxxxx:3000
    - Accounts_UseDNSDomainCheck=True
  links:
    - db:db
  ports:
    - 3000:3000

hubot:
  image: rocketchat/hubot-rocketchat:v0.1.4 # rocketchat/hubot-    rocketchat
  environment:
    - ROCKETCHAT_URL=http://xxxxxxx:3000
    - ROCKETCHAT_ROOM=
    - LISTEN_ON_ALL_PUBLIC=true
    - ROCKETCHAT_USER=alicja
    - ROCKETCHAT_PASSWORD=xxxxx
    - BOT_NAME=alicja
    - EXTERNAL_SCRIPTS=hubot-help,hubot-seen,hubot-links,hubot-    greetings, example.coffee
  links:
    - rocketchat:rocketchat
# this is used to expose the hubot port for notifications on the host     on port 3001, e.g. for hubot-jenkins-notifier
  ports:
    - 3001:8080

EDIT:

I reinstalled both hubot and rocket.chat using docker-compose and now it looks like bot is connected to rocket-chat (green light), but it does not respond (trying @botname help).

Again, here is my docker-compose.yml:

http://pastebin.com/rYrRGqfz

Thanks in advance for any help.

EDIT 2

OK. hubot is up. I had to change:

image: rocketchat/hubot-rocketchat:v0.1.4

to:

image: rocketchat/hubot-rocketchat:latest 

in hubot part of .yml

Apparently there is a problem when rocketchat imagee rocketchat image_and _hubot image are different (DUH...)

But still how do I service hubot started with docker-compose? For instance. Where (folder location), should I run npm install [script name] to add it to hubot? The same folder in which .yml file is located?

How can I customise scripts? Where are they located?


Solution

  • There are two questions above:

    • How to run hubot

      • Change your docker-compose.yml, where it says - ROCKETCHAT_URL=xxx.xxx.xxx.xxx:3000 change it to - ROCKETCHAT_URL=rocketchat:3000. You should connect to hubot through the link in the containers.

      • Indeed, you should be using hubot-rocketchat:latest with Rocket.Chat version above 0.37

    • How to customize with your own scripts

      • You have to map a volume from your host to your container. You can do this by adding volumes: to your docker-compose.yml. If you had your custom scripts inside a scripts folder, in the same directory as docker-compose.yml, you'd add it like this:
      volumes:
        - ./scripts:/home/hubot/scripts
    

    The sample for my docker-compose.yml can be found here: http://pastebin.com/KKX0Kuma