оболочка hubot не загружает скрипты и пакеты

Hubot работает, когда у меня есть адаптер, но когда я пытаюсь выполнить локальную разработку с помощью Shell, ни один из сценариев или пакетов не загружается.

Это работает:

  root@dev:~/hubot# bin/hubot forever start -w --watchDirectory ${PWD} --watchIgnore ${PWD}/*.log --pidfile ${PWD}/hubot.pid -l ${PWD}/hubot.log -a -c coffee node_modules/.bin/hubot --adapter slack

Как ни странно, когда я пытаюсь выполнить локальную разработку и тестирование с помощью:

 root@dev:~/hubot# bin/hubot
 [Thu Apr 07 2016 00:33:10 GMT+0000 (UTC)] INFO hubot-redis-brain: Using default redis on localhost:6379
 eve>
 eve> help
 usage:
 history
 exit, \q - close shell and exit
 help, \? - print this usage
 clear, \c - clear the terminal screen

Ни один из моих сценариев или модулей не отображается, когда я набираю справку в оболочке. Но когда я делаю это в slack, я вижу все доступные скрипты и модули:

 eve <user> doesn't have <role> role - Removes a role from a user
 eve <user> has <role> role - Assigns a role to a user
 eve adapter - Reply with the adapter
 eve delete reminder <action> - Delete reminder matching <action> (exact match required)
 eve deploy <gitsha> to production - Runs Jenkins Phase 1 deployment.
 eve echo <text> - Reply back with <text>
 eve flip production pools - Flips the yin and yang production pools
 eve help - Displays all of the help commands that Hubot knows about.
 eve help <query> - Displays all help commands that match <query>.
 eve list jobs - List current cron jobs
 eve new job "<crontab format>" <message> - Schedule a cron job to say something
 eve new job <crontab format> "<message>" - Ditto
 eve new job <crontab format> say <message> - Ditto
 eve ping - Reply with pong

** Обновление 1: я включил ведение журнала уровня отладки и вижу, что скрипты анализируются, но скрипты недоступны для меня при выполнении их команд :(**

[Чт, 07 апр 2016, 00:46:44 GMT+0000 (UTC)] DEBUG Загрузка оболочки адаптера накануне> [Чт, 07 апр 2016, 00:46:44 GMT+0000 (UTC)] DEBUG Загрузка скриптов из /root/hubot/scripts [Чт, 07 апреля 2016 г., 00:46:44 GMT+0000 (UTC)] Помощь при разборе DEBUG для /root/hubot/scripts/example.coffee [Чт, 07 апреля 2016 г., 00:46:44 GMT+0000 (UTC)] Разбор отладки справка для /root/hubot/scripts/prod_deploy.coffee [четверг, 07 апреля 2016 г., 00:46:44 GMT+0000 (UTC)] Справка по разбору отладки для /root/hubot/scripts/remindme.coffee [четверг, 07 апреля 2016 г., 00: 46:44 GMT+0000 (UTC)] Помощь при разборе DEBUG для /root/hubot/scripts/team_tools.coffee [Чт, 07 апреля 2016 г., 00:46:44 GMT+0000 (UTC)] Помощь при разборе DEBUG для /root/hubot/ scripts/update.coffee [Чт, 07 апреля 2016 г., 00:46:44 GMT+0000 (UTC)] DEBUG Загрузка скриптов из /root/hubot/src/scripts [Чт, 07 апреля 2016 г., 00:46:44 GMT+0000 (UTC) ] DEBUG Загрузка скриптов hubot из /root/hubot/node_modules/hubot-scripts/src/scripts [Чт, 07 апреля 2016 г., 00:46:44 GMT+0000 (UTC)] DEBUG Загрузка внешних скриптов из npm пакеты [Чт, 07 апреля 2016 г., 00:46:45 GMT+0000 (UTC)] Помощь по разбору DEBUG для /root/hubot/node_modules/hubot-diagnostics/src/diagnostics.coffee [Чт, 07 апреля 2016 г., 00:46:45 GMT+ 0000 (UTC)] ИНФОРМАЦИЯ hubot-redis-brain: использование redis по умолчанию на локальном хосте: 6379 [четверг, 07 апреля 2016 г., 00:46:45 GMT+0000 (UTC)] DEBUG Справка по анализу для /root/hubot/node_modules/hubot-redis -brain/src/redis-brain.coffee [четверг, 07 апреля 2016 г., 00:46:45 GMT+0000 (UTC)] Помощь по разбору DEBUG для /root/hubot/node_modules/hubot-auth/src/auth.coffee [четверг апр 07 2016 00:46:45 GMT+0000 (UTC)] Помощь по разбору DEBUG для /root/hubot/node_modules/hubot-help/src/help.coffee [Чт, 07 апр 2016, 00:46:45 GMT+0000 (UTC) ] DEBUG Помощь по разбору /root/hubot/node_modules/hubot-cron/src/scripts/cron.coffee

Обновление 2. Я понял, что часть моей проблемы заключается в том, что в файле bin/hubot имя моего бота явно указано как eve, в то время как я пытался сделать это с evedev, моим именем hubbot для разработки. Однако мне все еще интересно, почему команда справки не показывает все доступные команды, а когда я нахожусь в Slack, показывает.


person buildmaestro    schedule 07.04.2016    source источник
comment
Эй, у меня есть вопрос. У меня проблемы с вечной работой на hubot. Пишет, что hubot не запускается. Какие-нибудь советы?   -  person Pak Chu    schedule 09.02.2018


Ответы (2)


В качестве ответа на ваше обновление 2 вам нужно указать имя бота перед вводом help, например:

myhubot> help
usage:
history
exit, \q - close shell and exit
help, \? - print this usage
clear, \c - clear the terminal screen

vs

myhubot> myhubot help
myhubot> Shell: myhubot adapter - Reply with the adapter
myhubot animate me <query> - The same thing as `image me`, except adds a few parameters to try to return an animated GIF instead.
myhubot echo <text> - Reply back with <text>
myhubot help - Displays all of the help commands that Hubot knows about.
myhubot help <query> - Displays all help commands that match <query>.
myhubot image me <query> - The Original. Queries Google Images for <query> and returns a random top result.
myhubot map me <query> - Returns a map view of the area returned by `query`.
myhubot mustache me <url|query> - Adds a mustache to the specified URL or query result.
myhubot ping - Reply with pong
myhubot pug bomb N - get N pugs
myhubot pug me - Receive a pug
myhubot the rules - Make sure hubot still knows the rules.
myhubot time - Reply with current time
myhubot translate me <phrase> - Searches for a translation for the <phrase> and then prints that bad boy out.
myhubot translate me from <source> into <target> <phrase> - Translates <phrase> from <source> into <target>. Both <source> and <target> are optional
ship it - Display a motivation squirrel
person rarrarrarrr    schedule 28.06.2016

Вы можете проверить свое текущее имя робота в bin/hubot

Похоже на exec node_modules/.bin/hubot --name "botname" "$@"

С приведенной выше настройкой имя бота будет botname

person gasolin    schedule 21.04.2016