Alright. How fast can I set up a Continuous Integration and Deployment pipeline with Visual Studio Online, Git, Visual Studio Express and Azure Websites the first time I set it up?
Now that I got your attention with a super-sexy title like that, please – *please*- keep in mind that this is by no means production worthy, neither a true continuous delivery or deployment. I dislike having disclaimers, but this is an important one. I don’t want anybody to think that I consider this equal to a production setup, I do however want more developers to give this a try and start learning someting that many, including me, consider to be a necessity for modern day development.
This took me 1 hour (I’m a junior developer) to set up and I used no documentation (I wanted to see how intuitive the tools were to use) . And the message is, there is no excuse not to learn this- you can get the basics and an environment to play with up and running in no time at all. Start (maybe) here and then use this as a first step towards really digging in into the awesomeness. I’ll write a longer article going into the details in a few weeks (as that will take a lot of time), but don’t wait- grab your computer and give it a try.
- For IDE I used Visual Studio Express (forgoing my Premium install for this test)– and it does include MSBuild and MSTest – you get a lot for free
- Azure Websites has a free trial (you acn skip that step if you want to)
- Visual Studio Online is free for up to 5 users.
Here is how and what I did. Few words, many pictures coming up- exactly how I like it.
I created an account at http://www.visualstudio.com and created a project.
Notice that I selected Git.
Since I have two Visual Studio’s installed and it launches the wrong one from the website when you try to open the project I had to open Visual Studio Express and connect to the TFS manually.
After I had done that I cloned the repository.
Then I created a new project and solution, and MVC app with tests
Then I made my first commit
And ah, yes please do add ALL my files
After the commit to the local repo it was time to push (sync) to the remote repo.
After syncing I could see my files online. yay.
Okay, I now want to run tests. Like so:
Build. Whatever I need it has something ‘build’ in its name (I did this without documentation and based on pervious experience with TeamCity and Git). Here maybe?
New build definition it is then.
Here are the steps:
I make another commit and sync, this should kick of my new build.
We have a very simple CI setup now. Hm. But I want to deploy.
I went to Azure and created a new website.
And from Visual Studio I went ahead and deployed a first manual deploy.
Then I remembered something from the Azure portal. This:
So I went ahead with it.
I had a new build definition in my project after that.
And you know what? It worked.
Notice the deployed tab!
So. Take an hour or two. Or maybe less. But do it. Word-heavy version coming up in a week or two. SEO and all you know. Although I prefer pictures over words.