hubot-azuredevopsplugin
v1.0.2
Published
A hubot plugin that helps users to automate their work-flows.
Downloads
4
Maintainers
Readme
hubot-azuredevopsplugin
A Hubot plugin that helps users to automate their work-flows. To use this plugin you should have Hubot, Redis, and 'Azure DevOps Extension for Azure CLI' installed.
Installation of Hubot:
Prerequisites:
- Slack chat client.
- Windows machine with PowerShell, latest version of PowerShell is recommended.
Insatallation steps:
- Install Node.js if it isn’t installed. You can find the latest or recommended here.
- Create a folder for the bot, you can name it whatever you want, for example: 'myhubot'. This is called as Hubot's home folder.
- In CMD change the working directory to the new created folder in previous step, then type the following command:
npm install -g yo generator-hubot
As a result all the Hubot required modules will be installed. - To initialize Hubot, first make sure you are in Hubot's home folder you created earlier, then execute in CMD the following command:
yo hubot --adatpter=slack
It will ask for some initialization data (author's name, bot's name, and optional description). Remember the bot's name because you will need it later. In this stage Hubot files and folders will be generated in the Hubot's home folder; the one we created earlier. - Navigate to “Configure Apps” link in your Slack team page, and search for Hubot. Select “Add Configuration” button; admin approval will be required. Type the Hubot's name you selected for the “Customize Name” entry then click “Save Integration” button, as a result Hubot will get configured to work with Slack and an API token will be generated for you.
- Add a new System Environment variable with the following details:
Name: “HUBOT_SLACK_TOKEN” Value: <Slack API token generated in the previous step>
- Open CMD and execute this command:
set HUBOT_SLACK_TOKEN=<Slack API token generated in the previous step>
- To run Hubot on Slack open CMD with administrator privilidges in the Hubot's folder and execute:
.\bin\hubot --adapter slack
This will run Hubot on Slack. Stop Hubot by pressingCtrl+C
in CMD.
Installation of Redis:
- Hubot supports different ways to be used as a brain storage (e.g. File, Redis), for this plugin we will use Redis as Hubot's brain. Redis enables Hubot's memory to be persistent.
- Download the latest MSI package from here. The MSI package will install Redis as a windows service.
- Go to Windows services by executing
services.msc
in the run window. Navigate to the 'Extended' tab, and make sure that the Redis service is running.
Installation of Azure DevOps Extension for Azure CLI:
This link will guide you how to install the Azure DevOps Extension for Azure CLI.
Installation of hubot-azuredevopsplugin plugin:
- Open CMD in Hubot's home folder and execute the following command:
npm install hubot-azuredevopsplugin --save
This will install the plugin and all the required dependencies. - Then add hubot-azuredevopsplugin to your
external-scripts.json
, this file is present in Hubot's home folder:[ "hubot-azuredevopsplugin" ]
- Open CMD and restart Hubot by executing the following command in Hubot's home folder:
.\bin\hubot --adapter slack