运维机器人-Hubot-Worktile

nodejs#

root@90fbd3bbc87e:~/myhubot# node -v
v15.3.0
root@90fbd3bbc87e:~/myhubot# npm -v
7.0.14

Worktile#

https://worktile.com

install#

// dr-xr-x---.   8 root root 4096 Dec  1 13:58 root
[root@pro-k8s-182 ~]# chmod 775 /root
[root@pro-k8s-182 ~]# chown -R 1000:0 /root/.npm
[root@pro-k8s-182 ~]# mkdir -p /opt/hubot/Worktile
[root@pro-k8s-182 ~]# chmod 775 -R /opt/hubot/Worktile
[root@pro-k8s-182 ~]# chmod 775 -R /root/.config
[root@pro-k8s-182 ~]# cd /opt/hubot/Worktile
[root@pro-k8s-182 Worktile]# yo hubot
? ==========================================================================
We're constantly looking for ways to make yo better!
May we anonymously report usage statistics to improve the tool over time?
More info: https://github.com/yeoman/insight & http://yeoman.io
========================================================================== Yes
                     _____________________________
                    /                             \
   //\              |      Extracting input for    |
  ////\    _____    |   self-replication process   |
 //////\  /_____\   \                             /
 ======= |[^_/\_]|   /----------------------------
  |   | _|___@@__|__
  +===+/  ///     \_\
   | |_\ /// HUBOT/\\
   |___/\//      /  \\
         \      /   +---+
          \____/    |   |
           | //|    +===+
            \//      |xx|

? Owner admin@jevic.cn
? Bot name worktile
? Description worktile
? Bot adapter campfire
   create bin/hubot
   create bin/hubot.cmd
   create Procfile
   create README.md
   create external-scripts.json
   create hubot-scripts.json
   create .gitignore
   create package.json
   create scripts/example.coffee
   create .editorconfig
                     _____________________________
 _____              /                             \
 \    \             |   Self-replication process   |
 |    |    _____    |          complete...         |
 |__\\|   /_____\   \     Good luck with that.    /
   |//+  |[^_/\_]|   /----------------------------
  |   | _|___@@__|__
  +===+/  ///     \_\
   | |_\ /// HUBOT/\\
   |___/\//      /  \\
         \      /   +---+
          \____/    |   |
           | //|    +===+
            \//      |xx|

npm notice created a lockfile as package-lock.json. You should commit this file.
+ hubot@3.3.2
+ hubot-redis-brain@1.0.0
+ hubot-help@1.0.1
+ hubot-diagnostics@1.0.0
+ hubot-heroku-keepalive@1.0.3
+ hubot-google-translate@0.2.1
+ hubot-maps@0.0.3
+ hubot-pugme@0.1.1
+ hubot-google-images@0.2.7
+ hubot-rules@1.0.0
+ hubot-shipit@0.2.1
+ hubot-scripts@2.17.2
added 94 packages from 53 contributors and audited 94 packages in 14.168s

1 package is looking for funding
  run `npm fund` for details

found 0 vulnerabilities

[root@pro-k8s-182 Worktile]# chmod 550 /root
[root@pro-k8s-182 Worktile]# npm install hubot-worktile --save
[root@pro-k8s-182 Worktile]# npm install hubot-conversation
[root@pro-k8s-182 Worktile]# npm install hubot-script-shellcmd --save
[root@pro-k8s-182 Worktile]# cp -R node_modules/hubot-script-shellcmd/bash ./
[root@pro-k8s-182 Worktile]# vim external-scripts.json
[root@pro-k8s-182 Worktile]# tail -n2 external-scripts.json
  "hubot-script-shellcmd"
]
[root@pro-k8s-182 Worktile]# ls bash/handlers/
helloworld  update

worktile start#

https://dev.worktile.com/document/hubot
此处的token就是添加机器人时显示的token多个使用逗号分隔
[root@node1 myhubot]# export HUBOT_BEARYCHAT_TOKENS=bd00e55956a3759886c21c1ac1fd17dd
[root@node1 myhubot]# export HUBOT_BEARYCHAT_MODE=rtm
[root@node1 myhubot]# export HUBOT_SHELLCMD_KEYWORD=run //命令别名
[root@node1 myhubot]# export EXPRESS_PORT=9090
[root@node1 myhubot]# nohup ./bin/hubot -a worktile 2&1> hubot.log
[root@node1 myhubot]# netstat -tnlp|grep 9090
tcp        0      0 0.0.0.0:9090            0.0.0.0:*               LISTEN      54886/node 

为了以后启动方便可以直接将变量写人文件:
[root@node1 myhubot]# cat /etc/profile.d/myhubot.sh 
export HUBOT_BEARYCHAT_TOKENS=bd00e5595121249886c21c1ac1fd17dd
export HUBOT_BEARYCHAT_MODE=rtm
export EXPRESS_PORT=9090
[root@node1 myhubot]# source /etc/profile 
这样以后就无需手动再次export
posted @   Jevic-Cn  阅读(265)  评论(0编辑  收藏  举报
编辑推荐:
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
阅读排行:
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· winform 绘制太阳,地球,月球 运作规律
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 上周热点回顾(3.3-3.9)
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
点击右上角即可分享
微信分享提示
主题色彩