Monday, 22 April 2013

Setting up Ian’s CI Development Environment (for TeamMentor)

Now that Ian (and Kofi) have pushed a couple commits (to his fork of TeamMentor) its time to set-up Ian's CI dev environment, so that his commits can be automatically tested and viewed on a live instance of TeamMentor.

First think to do is to go to Azure and create a website to hold Ian’s Fork

image image

Which is going to be http://tm-ian.azurewebsites.net/

See the post Creating a new TeamMentor test site using TeamCity, GitHub and Azure for more details about how TeamCity is usally configured. The only major change for Ian's version, is that TeamCity is going to track the ‘azure’ branch (vs the master branch)

image

(See my next post for more details on how this azure branch was created)

Once TM is set-up and this TeamCity build is ‘Run’ , the Azure site goes from:

image

to:
 image
to:

image

And when completed we will have a clean TM site based on Ian’s repository (azure branch):

image

Finally, so that Ian has some data to play with, I logged in as admin and quickly added a couple libraries:

image

Running NUnit tests in TeamCity:

I also configured TeamCity to run the NUnit UnitTests from Ian's solution.

And in this case there is 1 test that fails:

image


which is also failing locally (i.e. in VisualStudio):

image

Which means that there is a side effect of one of Ian’s code changes (which he will need to fix on his repo :) )

Confirming Git to TeamCity to Azure

To double check that the workflow is working ok, let’s make a file change:

In the TM Website Settings,js file:

image

lets append Ian’s name to the build version:

image

This change is picked up by Git:

image

Where we can commit it locally (note the ‘azure’ branch)

image

and Push it to GitHub:

image

Making sure both local and remote branches are azure:

image

After the push is done:

image

TeamCity with trigger the build (TeamCity checks for new GitHub commits every 60sec):

image

Azure will be pushed the new version (which is fast):

image

A refresh of the https://tm-ian.azurewebsites.net site confirms the change (notice the 'Ian' next to the version):

image

Re-deploying a previous 'Azure deployed' version.

Note that it is also possible to go back a couple deployed versions in Azure. Just select the deployment and click on ‘REDEPLOY’

image

Which will change the active deployment:

image