fandrei / AppMetrics

Apache License 2.0
8 stars 2 forks source link

Configure TFS2010 build #115

Closed mrdavidlaing closed 11 years ago

mrdavidlaing commented 12 years ago

To adhere to City Index internal development standards, the projects need to be built under TFS2010.

We need a way to import the GitHub projects into TFS (perhaps http://gittf.codeplex.com/)

The TFS builds should generate the same packages as the Jenkins build, so that packages created with TFS can be installed using the existing Installation Guides

mrdavidlaing commented 12 years ago

I have created a TFS2010 + VS2010 server in the AWS-labs-EU-west environment named: TFS2010 (46.51.176.50) i-c5e2df8d with Elastic IP 46.51.176.50

This m1.large machine should be left in the stopped state when not in use. Start it via the EC2 Web console, and don't forget to reassign the correct Elastic IP.

Login credentials can be obtains from the Credentials tag

The screenshot below shows how TFS has initially been configured:

  1. The GitHub projects have been cloned to C:\Dev\GitHub.
  2. Mirror TFS projects have been setup, with their workspaces checked out to C:\Dev\TFS\CIAPI_Latency_Collector
  3. 2 TFS builds have been created, which attempt to build the AppMetrics & CIAPILatencyCollector projects.
fandrei commented 12 years ago

I don't understand completely, how this works together. Does it pull changes from Git on every build? The first problem I've found is that some files can't be updated during build because of read-only attribute (probably set by TFS). Should we checkout this files before build, or just reset read-only attribute?

mrdavidlaing commented 12 years ago

Currently we have no automated process for moving from GitHub to TFS. To begin with, I don't think we need an automated one; just a defined manual process that we can follow should be fine for now.

Our options are:

  1. Completely manual - looses Git commit history - done once / production release
    1. git pull into the C:\Dev\GitHub locations.
    2. TFS Checkout to the C:\Dev\TFS locations (must let TFS remove readonly attrib, or it gets confused)
    3. Copy from C:\Dev\GitHub => C:\Dev\TFS
    4. TFS Checkin, triggers TFS build.
  2. Git-TF driven - retains Git commit history - done once / production release
    1. git pull into the C:\Dev\GitHub locations.
    2. git tf checkin from C:\Dev\GitHub locations into TFS, triggers TFS build.

I'll leave you to choose which one has the right "easy to implement / most elegant" balance.

In both cases we need a TFS build script that will build the same set of output packages as the Jenkins build script.

fandrei commented 12 years ago

Not sure about Git-Tf; when I'm trying to use it, getting this error message: git-tf: User config file C:\Users\Administrator.gitconfig invalid org.eclipse.jgit.errors.ConfigInvalidException: Cannot read file C:\Users\Administrator.gitconfig UPD if it says file is invalid, probably this is due to Git updated config file format

Anyway, according to the documentation http://download.microsoft.com/download/A/E/2/AE23B059-5727-445B-91CC-15B7A078A7F4/Git-TF_GettingStarted.html, Git history won't be transferred to TFS. So I'll try to stick to the first approach. However, the problem here is how to deal with added/deleted files.

mrdavidlaing commented 12 years ago

Agree with your analysis.

Concerning dealing with deleted files - how about doing the copy step using a merge tool like win-merge. Or a windows rsync clone.

fandrei commented 12 years ago

Solved the problem with Git-TF, it was due to config file encoding (only ANSI is accepted)

Q: we need to run only build, or full build-and-test suite? If second option, where to setup web applications?

mrdavidlaing commented 12 years ago

Just run the build + unit tests. Don't run the integration tests.

On Thu Sep 6 06:30:43 2012, Andrei Faber wrote:

Solved the problem with Git-TF, it was due to config file encoding (only ANSI is accepted)

Q: we need to run only build, or full build-and-test suite? If second option, where to setup web applications?

— Reply to this email directly or view it on GitHub https://github.com/fandrei/AppMetrics/issues/115#issuecomment-8322957.

fandrei commented 12 years ago

Build is successful. Now I need to fix unit tests. I put git-tf update script here: C:\Dev\update.bat

mrdavidlaing commented 12 years ago

:+1: Go you!

fandrei commented 11 years ago

Unit tests are working now, but I'm struggling with OpenCover. It gives this error, when running in the TFS system:

No results - no assemblies that matched the supplied filter were instrumented this could be due to missing PDBs for the assemblies that match the filter please review the output file and refer to the Usage guide (Usage.rtf)

All PDBs are present and up-to-date. Have you ever had such error?

mrdavidlaing commented 11 years ago

I vote for not including OpenCover in the TFS build for now.

fandrei commented 11 years ago

Maybe we can keep it as it is now (OpenCover is running, but not generating any results).

I've found, that the problem is somewhat related to type filtering. With filter

"-filter:+[*]*"

it works, but when some type exclusions are added (for CassiniDev, etc)

"-filter:+[*]* -[Test*]* -[ApiGeoIP*]* -[CassiniDev*]*"

OpenCover doesn't work on TFS machine correctly. But exactly the same parameters are working on Jenkins and my local machine. Weird.

fandrei commented 11 years ago

Software setup:

install Java (required for git-tf); add to the PATH variable install git-tf; add to the path install WiX apply SP1 to VS2010 (was required after WiX installation)

PS copy update script C:\Dev\update.bat to the target machine