Panel
borderColorgreen
titleConfiguration

Individual bots can be set up manually by the process described below:

  • Clone our OnBot repository from github (git clone 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
  • Run: npm install
  • Now set the required environment variables (As mentioned below in Environment Variables for specific bots section)
  • Finally, start the bot as a background process (logs will be redirected to hubot.log file): nohup ./bin/hubot -a slack > hubot.log &


    Info

    Before starting the bot, Run npm install hubot-<adapter> to install specific node module for the adapter (chat application) you want to use.


    Note

    At any time the bot running in background can be stopped by this command: ps aux | grep -ie <botname> | awk '{print $2}' | xargs kill -9

    The <botname> can be fetched from the following line of the bin/hubot file:

    exec node_modules/.bin/hubot --name "botname" "$@"


...

Panel
borderColorgreen
titleEnvironment Variables for specific bots


Expand
titlebuildon


HUBOT_GIT_SOFTWARE (GitLab or GitHub)
HUBOT_GITLAB_IP (GitLab server IP)
GITLAB_SERVICE_TOKEN
HUBOT_BUILDON_SERVICE (buildon_host_address)
POSTGRES_LINK (jdbc:postgresql://<username>:<password>@<postgres_server_IP>:<port>/postgres)
BUILDON_TABLE_NAME



Expand
titlegithub


HUBOT_GITHUB_API (https://api.github.com)
HUBOT_GITHUB_USER (github username)
HUBOT_GITHUB_TOKEN (github_token)
HUBOT_GITHUB_REPO (optional)



Expand
titleinsights-grafana


HUBOT_GRAFANA_HOST
HUBOT_GRAFANA_API_KEY

NEO4J_USERNAME

NEO4J_PASSWORD
INSIGHT_URL
CHANNEL_ID (channel ID for slack/Hipchat and channel name for mattermost where grafana panel images will be uploaded)
AUTH_TOKEN (Authentication token with upload permission)



Expand
titlejenkins


HUBOT_JENKINS_URL
HUBOT_JENKINS_USER
HUBOT_JENKINS_PASSWORD
HUBOT_JENKINS_API_TOKEN
HUBOT_JENKINS_VERSION



Expand
titlenexus


NEXUS_USER_ID
NEXUS_PASSWORD
NEXUS_URL



Expand
titlerundeck


RUNDECK_URL
RUNDECK_TOKEN
RUNDECK_USERNAME
RUNDECK_PASSWORD



Expand
titlescalr


SCALR_API_URL
SCALR_ACCESS_ID
SCALR_ACCESS_KEY
SCALR_ENV_ID
NODE_TLS_REJECT_UNAUTHORIZED
SCALR_PROJECT_ID
SCALR_CLOUD_PLATFORM
SCALR_CLOUD_LOCATION
SCALR_NETWORK_ID
SCALR_SUBNET_ID
SCALR_SECURITY_GROUP_ID



Expand
titlesonar


SONAR_URL
SONAR_USER_ID
SONAR_PASSWORD



Expand
titleudeploy


UDEPLOY_URL
UDEPLOY_USER_ID
UDEPLOY_PASSWORD



Expand
titleurelease


URELEASE_URL
URELEASE_USER_ID
URELEASE_PASSWORD



Expand
titlexldeploy


XLDEPLOY_URL
XLDEPLOY_USER_ID
XLDEPLOY_PASSWORD



Expand
titlexlrelease


XLRELEASE_URL
XLRELEASE_USERNAME
XLRELEASE_PASSWORD



Expand
titleJFrogArtifactory


ARTIFACTORY_HOST
ARTIFACTORY_USER
ARTIFACTORY_PASSWORD



Expand
titleCARally


API
USERNAME
PASSWORD
API_TOKEN



Expand
titleTeamcity


HUBOT_TEAMCITY_URL

HUBOT_TEAMCITY_USERNAME

HUBOT_TEAMCITY_PWD



Panel
borderColor#31B3EB
borderWidth2
titleEnvironment variables common for all bots

EXPRESS_PORT (Port number where the hubot will run)
MONITOR_INTERVAL (Time Interval for monitoring bot)
MONITOR_RETENSION (mapped to 1 (stores a jsonobj in elasticsearch which has all hubot metrics of a current second))
MONGO_DB_URL (mongodb database name for approval process of bot actions)
MONGO_COLL (mongodb collection name for approval process of bot actions)
MONGO_COUNTER (mongodb collection name for storing the number of next ticket to be generated)
MONGO_TICKETIDGEN (stores the Id of the collection referred by MONGO_COUNTER)
APPROVAL_APP_URL (middleware application endpoint which will handle approval flow in mattermost)
MONGO_DB_NAME (The database name which has MONGO_COLL and MONGO_COUNTER in it)


...