Thursday, 14 March 2013

Creating a new TeamMentor test site using TeamCity, GitHub and Azure

Serge just asked me to create a new TeamMentor (TM) website for him using a particular TM library, so here are the steps I took (note: some of this will be automated in the next TM release)

In Azure .... 

It all started by going into Azure and creating a new website:

image

In this case called tm-hashes

image

in a couple secs it was available

image

next I set-up git publishing:

image

using  ‘Local Git’ since that works well with TeamCity and doesn't require that Azure is given pull privileges into the target repo:

image

Azure worked for a bit, and after a couple secs I had:

image

In TeamCity ...

Next, in the TeamCity server, to make it easier on next deployments, I added this site to one of the builds that already pushes other sites into Azure:

image

Specifically I added another build-step similar to the ones already there for tm-vulnerabilities and tm-DennisGroves

image

The easiest way to do it, was to create a copy of one of the existing steps:

image

After editing the 'copied build step', called 'Publish to Azure (tm-Hashes)',  I quickly reordered the build steps

from: image  to:  image

Next, I clicked on Run:

image

in order to trigger a TeamCity build:

image

That build will:

  • do a git pull from the latest version of the TM code (currently at 3.3 RC3.01), 
  • build the visualstudio main project, 
  • and push to Azure

Here are the bulid logs during the 'push to Azure' step:
image

At this moment the Azure admin page for the tm-hashes site, will show a ‘Deploying’ message

image

which becomes 'Active Deployment' once it is completed:

 image

One of the nice hacks the Azure team did with their git implementation is to provide good messages/info in the git data sent back on pushes (the lines in dark-orange below where created by Azure):



Once the push in complete, we can browse the Azure site:

image

And see an empty TeamMentor installation:

image

In TM Control panel using GitHub zip file ...

The final step is to add the library that Serge wants (note: for this example I’m going to install the library via drag and drop of zip files.)

To get the library files, I went to its private Github Repositor, and clicked on the zip button

image

which downloaded the zip file into my current vm:

image

back in TeamMentor,

I logged in:

image

as admin

image

went to the control panel:

image

clicked on ‘Advanced Admin Tools’ and ‘Install/Upload Libraries

image image

drag-n-dropped the local zip file into the ‘Upload a file’ red box

image

Depending on the network speed, this can take a couple seconds or minutes:

image

Once the upload was completed,

I clicked on the 'Lib_Hashes-master.zip’ link that appeared at the top:

image

waited a little bit:

image

and once I saw the success message:

image

I clicked on Open Main Page

image

and the main TeamMentor Gui showed the imported libraries:

image

The final step was to remove the original temp library (created by TeamMentor on first install)

image  image image

And finally, I sent Serge an email with the link to his brand new install of TeamMentor :)

image
Post a Comment