2

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?

  • How are you running hubot? If it's in your docker-compose.yml, it should automatically come up when you do a `docker-compose up`. Can you check the logs? – Marcelo Schmidt Oct 05 '16 at 20:14
  • I removed my previous comment and edited my question above. Rocket.Chat is up hubot is also up but does nor respond. How do I check logs? – Łukasz Woś Oct 06 '16 at 07:41

1 Answers1

3

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

Marcelo Schmidt
  • 609
  • 4
  • 15
  • Thanks a lot. Docker-compose starts to make sense to me at last. Slowly, but still... One more question. Can I edit scripts which are in EXTERNAL_SCRIPTS section of docker-compose.yml? If so, Where can I find them? Or should I rewrite them and post them in npm and then import them? Anyway, you were really helpful in my hubot experience. Thanks for swift responses. – Łukasz Woś Oct 06 '16 at 12:31
  • I've never tried editing files inside the container. Personally, I think the best way would be to add it to your custom scripts folder and remove from the list above. – Marcelo Schmidt Oct 06 '16 at 12:43
  • 1
    Definitely easiest way is by adding removing from list and putting in scripts. Though I would say.. if you're making improvements, best would be to go upstream and open a pull request on that package, so others can benefit from your changes :) – Aaron Ogle Oct 06 '16 at 13:47
  • hi, I have setup hubot with rocket chat. And got connected successfully. But it is not responding to me. I posted another question for the same https://stackoverflow.com/questions/52659602/rocket-chat-hubot-adapter-is-not-replying-back – jitendra rajput Oct 05 '18 at 09:03