Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Sample file already available. To create bots containers of kind “pod”

Individual bots can be set up manually without nodeservices also. The process is described below:

  • Clone our OnBot repository from github (git clone -b master https://github.com/CognizantOneDevOps/OnBot.git)
  • Copy the desired bot scripts from the scripts folder of the cloned repo
  • Run this command: npm install -g yo generator-hubot
  • Create a parent folder myhubot
  • Run the following commands:

          cd myhubot

          yo hubot

  • Copy the scripts from the cloned repository (first step) into myhubot/scripts folder
  • Copy the workflow.json and package.json file into the myhubot directory


Panel
borderColorgreen
titleConfiguration

NodeServices config file

location

Description

config.json

app/config/config.json

config.json template is available. Update your environment specific values which are required to start NodeServices

To enable approval flow for mattermost adapter

set "APPROVAL_APP_URL=http://middleware-ip:port/endpoint" in config.json

certificate.pem , key.pem

must be placed in root of the project which is parallel to app.js

Generate certificate and private key pem files

admin.conf

must be placed in root of the project which is parallel to app.js

It can be found in kubernets master node instance. Path: /home/Ubuntu/admin.conf or /etc/kubernetes/admin.conf

ubuntu.yaml

app/config/ubuntu.yaml which is parallel to config.json


Performs all container specific actions like create container, get logs from container, copying scripts into container, execute bot start/restart scripts in container,
Panel
borderColorgreen
titleNodeServices Scripts


Panel
borderColorgreen
titleStart NodeServices

Install dependencies with the following command:

  • npm install
Info

npm install will install the dependencies that are listed in package.json


Run the app with the following command:

  • nodejs app.js

Scripts/Controller

Description

deploybot.js

Used to add/delete/stop the bot

elasticApi.js

 

Connects to elasticsearch to fetch the metrics , hitmiss ratio and chatlogs of a bot

hubotscripts.js

Construct shell scripts to start/stop/restart bot. Also, copying the workflow.json into container after edit.

kubectlapi.js

 

  • .
using the Kubernetes.routes.
  • js
mongodb query executions to add bot info as document, fetch document, update document and appending new values to a document.