1
Vote

Setup continuous integration

description

Issue

Having a CI build has many benefits. if nothing else but a clean build and test environment to keep everyone honest.

TeamCity is well-known platform for CI.
The NuPattern project has a full -license for TeamCity.

Suggestion

Anyone with TeamCity experience?
Please help us decide what the options are, what tools we need, and how set this up for the project.
And of course whether we should or not?

comments

dcazzulino wrote Apr 10, 2013 at 3:57 AM

Ping the code better guys. Most well known OSS projects use their teamcity.codebetter.com servers...

We should most definitely Not maintain our own build server

jezzsa wrote May 5, 2013 at 11:38 PM

OK, seems like we can go with teamcity.codebetter.com, they support open source projects too.

I will take the action to get this underway.

dcazzulino wrote May 20, 2013 at 6:52 PM

I just checked that they don't have VS at all installed on the build server. It means that we will most probably NOT be able to build our source.

I'm experimenting with sync'ing the source to nupattern.visualstudio.com (I created the NuPattern team project there) and using the TFS build service there. We may have a far better chance. Thankfully, they now support Git too for SCC, so it should be very straightforward to sync both repos (straight push to another remote and that's it).

If it works, we may be able to automate more of the build process, maybe even some parts of the signing?

jezzsa wrote May 20, 2013 at 9:43 PM

Just keep in mind. The way I have designed the source tree, we should have ALL build dependencies in the Lib folder. Which should allow us to build on a CI environment without any VS installed.
I haven't been able to test that concept completely yet, but we should be 98% of the way there to building on a clean environment. (I hope).

dcazzulino wrote May 21, 2013 at 12:53 AM

There are a ton of VS references (I.e. DTE, shell, shell.interop etc.),
which I don't see copied, neither I think you can per license... You can
with SDK ones, which is what I think you're referring to

jezzsa wrote May 21, 2013 at 11:14 PM

All VS assemblies we reference are there (or should be).
I dont beleive we are in breach of any license, as we dont redistribute them - unless I misunderstand that somehow.

jezzsa wrote May 26, 2013 at 9:47 AM

Update.
I've been working hard on getting this one closed, but no luck - I need some new ideas.

At present, we have both a build setup on CodeBetter (http://teamcity.codebetter.com/project.html?projectId=project353&tab=projectOverview) and in TFS Online (https://nupattern.visualstudio.com/DefaultCollection/NuPattern).
Neither of these builds currently completes without errors.

I have had to resolve the issue with GIT not converting LF to CRLF, which TFS Online was not doing by default, and seems no way to force it. Although, you can control this with the CodeBetter build.
We solved this with an .gitattributes file at the root that overrides any local GIT repo settings around core.autocrlf. Apparently, the recommended approach for Windows based GIT projects, as recommended and detailed by GITHUB help.
This fixed the random obscure errors for Text Transformation, caused by *.tt's seeing LF line-endings.

Then we had issues with missing targets, MSBUILD properties, and several missing assemblies/includes/binaries from both VSSDK and VMSDK which would obviously NOT be present on the build servers.

With all those issues worked out (and verified) on a desktop machine (without VSSDK and VMSDK installed) the builds on the build servers are still failing for unknown root causes.

Build ARE working on a desktop machine with only VS2010 and VS2012 installed (no VSSDK or VMSDK in either VS version). All dependencies, asemblies, tools, binaries, includes, targets, etc. are in the source code 'Lib' folder now.

The TFS Online builds ARE NOT working, and report ERROR log:
Build started 5/26/2013 5:18:19 AM.
Project "C:\a\src\Src\CI.proj" on node 1 (default targets).
Project "C:\a\src\Src\CI.proj" (1) is building "C:\a\src\Src\Runtime\Runtime.vs2010.sln" (2) on node 1 (Rebuild target(s)).
ValidateSolutionConfiguration:
  Building solution configuration "Debug-VS2010|Mixed Platforms".
Project "C:\a\src\Src\Runtime\Runtime.vs2010.sln" (2) is building "C:\a\src\Src\Runtime\Source\Runtime.Core\Runtime.Core.csproj.metaproj" (3) on node 1 (Rebuild target(s)).
Project "C:\a\src\Src\Runtime\Source\Runtime.Core\Runtime.Core.csproj.metaproj" (3) is building "C:\a\src\Src\Common\Source\Versioning\Versioning.csproj" (4) on node 1 (Rebuild target(s)).
CleanT4TrackingFiles:
  Removing T4 tracking data to force a full transform
CoreClean:
  Creating directory "obj\Debug-VS2010\".
C:\a\src\Lib\VMSDK\10.0\TextTemplating\v10.0\Microsoft.TextTemplating.targets(396,5): error MSB4062: The "TransformTemplates" task could not be loaded from the assembly C:\a\src\Lib\VMSDK\10.0\TextTemplating\v10.0\Microsoft.TextTemplating.Build.Tasks.dll. Could not load file or assembly 'file:///C:\a\src\Lib\VMSDK\10.0\TextTemplating\v10.0\Microsoft.TextTemplating.Build.Tasks.dll' or one of its dependencies. The module was expected to contain an assembly manifest. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. [C:\a\src\Src\Common\Source\Versioning\Versioning.csproj]
Done Building Project "C:\a\src\Src\Common\Source\Versioning\Versioning.csproj" (Rebuild target(s)) -- FAILED.
Done Building Project "C:\a\src\Src\Runtime\Source\Runtime.Core\Runtime.Core.csproj.metaproj" (Rebuild target(s)) -- FAILED.
Done Building Project "C:\a\src\Src\Runtime\Runtime.vs2010.sln" (Rebuild target(s)) -- FAILED.
Done Building Project "C:\a\src\Src\CI.proj" (default targets) -- FAILED.

Build FAILED.

"C:\a\src\Src\CI.proj" (default target) (1) ->
"C:\a\src\Src\Runtime\Runtime.vs2010.sln" (Rebuild target) (2) ->
"C:\a\src\Src\Runtime\Source\Runtime.Core\Runtime.Core.csproj.metaproj" (Rebuild target) (3) ->
"C:\a\src\Src\Common\Source\Versioning\Versioning.csproj" (Rebuild target) (4) ->
(ExecuteTransformations target) -> 
  C:\a\src\Lib\VMSDK\10.0\TextTemplating\v10.0\Microsoft.TextTemplating.targets(396,5): error MSB4062: The "TransformTemplates" task could not be loaded from the assembly C:\a\src\Lib\VMSDK\10.0\TextTemplating\v10.0\Microsoft.TextTemplating.Build.Tasks.dll. Could not load file or assembly 'file:///C:\a\src\Lib\VMSDK\10.0\TextTemplating\v10.0\Microsoft.TextTemplating.Build.Tasks.dll' or one of its dependencies. The module was expected to contain an assembly manifest. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. [C:\a\src\Src\Common\Source\Versioning\Versioning.csproj]

    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:02.37 
The CodeBetter builds ARE NOT working, and report ERROR log:
D:\BuildAgent-03\work\f93904bdb07dc82b\Lib\VSSDK\10.0\MSBuild\Microsoft.VsSDK.Common.targets(74, 5): Failed to load 'D:\BuildAgent-03\work\f93904bdb07dc82b\Lib\VSSDK\10.0\MSBuild\bin\VSCT.exe' Assembly. 
Project Src\Runtime\Source\Runtime.Shell\Runtime.Shell.csproj failed. 
Project Src\Runtime\IntegrationTests\Runtime.IntegrationTests.csproj failed. 
Project Src\Runtime\IntegrationTests\Runtime.IntegrationTests.csproj.metaproj failed. 
Project Src\Runtime\Source\Runtime.Shell\Runtime.Shell.csproj failed. 
Project Src\Runtime\Runtime.vs2010.sln failed. 
At this point, I am unable to resolve this.
Anyone have any new ideas?

jezzsa wrote May 27, 2013 at 7:35 AM

So it appears that the teamcity.codebetter servers really dont have Visual Studio installed. Despite what the options are for build agents in the UI allow me to do. It has now been confirmed that no VS of any version is installed on those build agents.

I just ran the Avanade Extensions to report what is actually installed on the TFS Online servers and Visual Studio (either version) is not one of the things listed as installed there. Although many dependencies of VS are installed. So I am going to read from that - that VS is not installed on the build agents on TFS online either.

Which brings me to the conclusion (finally) that we need this codebase to build without VS being installed on the build machine.

So, I will be setting up a test machine without VS, and just .NET framework installed to see what the missing dependencies are to get the code to build.

We are pretty close to having everything we need already in the codebase ('Lib' folder), so its now just a matter of what we took for granted, or what is missing there.

jezzsa wrote Jun 23, 2013 at 9:10 AM

I have been working on this now for 3 weeks.
We have two CI servers setup and running.
The first one is TFSOnline. But we have hit a road block with the DelaySign issue, and not being able to skip verification for our assemblies. Not much we can do about that.

The second one is the teamcity.codebetter CI build, which has proceeded past the skip verification stage, as the admins have made an exception for us. THese build servers don't have VS installed, but should build with just the .NET framework installed.
http://teamcity.codebetter.com/project.html?projectId=project353&tab=projectOverview

The issue we are now faced with is some bazaar error related the T4 targets not working for the VS2012 solutions. It builds fine for the VS2010 solutions.
The weird thing is that this build fails for a different reason when run on a build server with .NET framework 4.5. The current build server has only .NET 4.0 installed.
So, we are stumped at this point. Perhaps its the version of the .NET framework, or something else.