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