Skip to end of metadata
Go to start of metadata
You are viewing an old version of this page. View the current version.
Compare with Current
View Page History
« Previous
Version 55
Next »
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
yo generator creates the package.json file under myhubot directory
Download the workflow_botname.json attached with the respective bots below, then rename it as workflow.json and place 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 &
buildon
Variable Name | Purpose |
---|
HUBOT_GIT_SOFTWARE | Specify which Software to be used for buildon (GitLab or GitHub) |
HUBOT_GITLAB_IP | The GitLab server IP |
GITLAB_SERVICE_TOKEN | Authentication token from gitlab |
HUBOT_BUILDON_SERVICE | The buildon_host_address |
POSTGRES_LINK | Postgres connection string (eg → jdbc:postgresql://<username>:<password>@<postgres_server_IP>:<port>/postgres) |
BUILDON_TABLE_NAME | Table name from which buildon reports are taken by bot |
github
Variable name | Purpose |
---|
HUBOT_GITHUB_API | Github API link (https://api.github.com) |
HUBOT_GITHUB_USER | Github username |
HUBOT_GITHUB_TOKEN | Github oAuth token with appropriate permissions (Refer here to learn more about github oAuth tokens) |
HUBOT_GITHUB_REPO | Default github repository name (optional) |
Gitlab
Variable name | Purpose |
---|
HUBOT_GITLAB_API | Gitlab API URL (eg - http://<gitlab_host_ip>/api/v4) |
HUBOT_GITLAB_USER | Gitlab user |
HUBOT_GITLAB_TOKEN | Gitlab Personal access token with appropriate permissions (Click here to learn more about Gitlab personal access tokens) |
insights-grafana
Variable Name | Purpose |
---|
HUBOT_GRAFANA_HOST | Grafana host url |
HUBOT_GRAFANA_API_KEY | Grafana API key |
NEO4J_USERNAME | Neo4j database username |
NEO4J_PASSWORD | Neo4j database password |
INSIGHT_URL | Insights host 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 |
jenkins
Variable name | Purpose |
---|
HUBOT_JENKINS_URL | Jenkins host URL |
HUBOT_JENKINS_USER | Jenkins username |
HUBOT_JENKINS_PASSWORD | Jenkins password |
HUBOT_JENKINS_API_TOKEN | Jenkins API token |
HUBOT_JENKINS_VERSION | Jenkins version (give upto 2 decimal only. eg - if version is 2.12.1, give 2.12) |
nexus
Variable name | Purpose |
---|
NEXUS_USER_ID | Nexus username |
NEXUS_PASSWORD | Nexus password |
NEXUS_URL | Nexus host URL |
Jira
Variable name | Purpose |
---|
HUBOT_JIRA_URL | Jira host URL |
HUBOT_JIRA_USER | Jira username |
HUBOT_JIRA_PASSWORD | Jira password |
rundeck
Variable name | Purpose |
---|
RUNDECK_URL | Rundeck host URL |
RUNDECK_TOKEN | Rundeck API token |
RUNDECK_USERNAME | Rundeck user name |
RUNDECK_PASSWORD | Rundeck password |
scalr
Variable name | Purpose |
---|
SCALR_API_URL | Scalr host URL |
SCALR_ACCESS_ID | Access ID of scalr |
SCALR_ACCESS_KEY | Access key of scalr |
SCALR_ENV_ID | Environment ID on which the bot should work |
NODE_TLS_REJECT_UNAUTHORIZED | To skip ssl validation |
SCALR_PROJECT_ID | Project ID on which the bot should work |
SCALR_CLOUD_PLATFORM | Scalr cloud platform (eg → ec2) |
SCALR_CLOUD_LOCATION | Cloud location of scalr (eg → us-west-2) |
SCALR_NETWORK_ID | Network ID on which bot should work (vpc) |
SCALR_SUBNET_ID | The subnet ID which is included in the above vpc |
SCALR_SECURITY_GROUP_ID | Security group ID which operates on the above subnet |
sonar
Variable name | Purpose |
---|
SONAR_URL | Sonar host URL |
SONAR_USER_ID | Sonar user name |
SONAR_PASSWORD | Sonar password |
udeploy
Variable name | Purpose |
---|
UDEPLOY_URL | Udeploy host URL |
UDEPLOY_USER_ID | Udeploy username |
UDEPLOY_PASSWORD | Udeploy password |
urelease
Variable name | Purpose |
---|
URELEASE_URL | Urelease host URL |
URELEASE_USER_ID | Urelease username |
URELEASE_PASSWORD | Urelease password |
xldeploy
Variable name | Purpose |
---|
XLDEPLOY_URL | XLDeploy host URL |
XLDEPLOY_USER_ID | XLDeploy username |
XLDEPLOY_PASSWORD | XLDeploy password |
xlrelease
Variable name | Purpose |
---|
XLRELEASE_URL | XLRelease host URL |
XLRELEASE_USERNAME | XLRelease username |
XLRELEASE_PASSWORD | XLRelease password |
artifactory
Variable name | Purpose |
---|
ARTIFACTORY_HOST | Artifactory host URL |
ARTIFACTORY_USER | Artifactory username |
ARTIFACTORY_PASSWORD | Artifactory password |
rally
Variable name | Purpose |
---|
API | Rally API URL |
USERNAME | Rally username |
PASSWORD | Rally password |
API_TOKEN | Rally API acess token |
teamcity
Variable name | Purpose |
---|
HUBOT_TEAMCITY_URL | Teamcity host URL |
HUBOT_TEAMCITY_USERNAME | Teamcity username |
HUBOT_TEAMCITY_PWD | Teamcity password |
EXPRESS_PORT (Port number where the hubot will run)
MY_POD_IP (Host address where bot is running)
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)
HUBOT_SLACK_TOKEN (API token for connecting with slack)
MATTERMOST_ENDPOINT (context of the endpoint where bot is running with mattermost adapter)
MATTERMOST_INCOME_URL (Mattermost Incoming webhook)
MATTERMOST_TOKEN (Mattermost outgoing token - to be configured with outgoing webhook)
To implement the approval flow with the bot, whichever collection name you put in MONGO_COUNTER variable(mentioned above) should be present inside the db set by MONGO_DB_NAME.
For example- suppose you have MONGO_COUNTER=counters and MONGO_DB_NAME=hubot set in your environment. Then you should have a database called "hubot" inside your mongodb. This "hubot" should contain a collection named "counters" having this structure: { _id: "ticketIdGenerator",seq: 100}
To create a collection like this, go to your mongo shell and execute below steps:
- use hubot
- db.createCollection("counters")
- db.counters.insert({_id: "ticketIdGenerator",seq: 100})
0 Comments