In this article I will walk through the steps to enable source control and continuous integration for your bot
Introduction
In previous articles we have seen how to create a sample bot and how to link it into Skype. In this article we are going to look at how to use Visual Services Team Studio (VSTS) to manage source control and eventually continuous integration. We are going to set up is an environment such that when you check your code into the repository a code deployment is triggered to the nodejs server (our bot in this case) which then finally restarts. In short: code checks in and everything refreshes automagically.
What is going to happen is that we are taking the code out of the Azure sample development web based IDE environment and move it to something a little more robust.
Selecting your Source Control
From your bot interface select settings and scroll down to the continuous integration section.
Note: it is really important to read the instructions – if you do NOT download the zip file of your bot first you will end up with a blank look on your face and a need to rebuild your bot from scratch – take it from this idiot (facepalm).
Download your zip file and then head over to your favorite source control repo and create one.
In my case I used Visual Studio Team Services (VSTS) to set up a git repo.
I unzipped the file locally and associated it with my new project in VSTS. I use JetBrains Webstorm as my JavaScript development environment but this would work just as well in Visual Studio or VS Code.
Setting up continuous integration
Back within the Azure bot development website click the Continuous Integration button. This will then cause you to move through a number of screens configuring the CI. For this to work you have to have configured your Azure environment to be linked with your VSTS environment. Here’s a great blog post describing how to do just that (Linking your VSTS Account to Azure)
So “Setup”
and then your project within VSTS
Which branch (master just to keep things simple for now)
et voila
Configuring a performance test
Following the prompts you can set up the perf test (for once the CI is complete)
and we now have your Azure bot being deployed from code sitting within VSTS. Cool 🙂
Example
I have my bot hooked up in Skype
I make a quick change to the message in WebStorm (my JavaScript IDE)
Commit and push
Head back to Skype and within about 60 seconds (it has to restart after all) we have a new message
What’s really interesting though is that I started my conversation before the restart was ready – but the message was queued and when the server woke up it finally responded – that was very cool
Conclusion
In this article we have looked at how to set up a VSTS source control repo of our new test bot and then configured continuous integration through the bot framework. I check in my new code and within seconds the new functionality is posted out to the live bot.
[…] the previous article we looked at how to create a sample azure bot and then how to configure it in VSTS for continuous integration. If you want to develop with this sample locally you will need to set it up to work with the […]