Continuous Integration

Topics: Core
Jul 17, 2014 at 1:36 PM
In some other threads (now very old threads), someone included the current Continuous Integration configuration for Orchard. Can you provide a newer version of the configuration? Also, is Orchard's actual CI available, anywhere?
Developer
Jul 17, 2014 at 3:36 PM
Edited Jul 17, 2014 at 3:36 PM
Hi Jay,

Orchard's CI is available on the official TeamCity servers.

We at Lombiq have built up a package of knowledge and automated tasks in the past year to improve the deployment process of our Orchard instances (using TeamCity and some PowerShell scripts, deploying to Microsoft Azure). With these tools we achieved zero-downtime deployment for all our websites, for example DotNest. I'd be happy to share more information about it if you're interested!
Jul 21, 2014 at 5:18 PM
Awesome. Thank you for the link.

Is there any way to view the current configuration? I can't view it on TeamCity without admin access. Even just a screenshot of the MSBuild build step would be enough. I'm having trouble configuring a sample project to build Orchard on TeamCity; a few of the unit tests are failing.

I must be missing something.
Developer
Jul 23, 2014 at 9:50 AM
Edited Jul 23, 2014 at 9:51 AM
You can log in with guest/guest or just click the "Log in as guest" link under the login form.

If you want to build a solution with MSBuild, there is configuration you need to make (I had my fun with it):
  • MSBuild version: Microsoft .NET Framework 4.5
  • MSBuild ToolsVersion: 4.0
  • Run platform: x86
  • Targets: Rebuild
  • Command line parameters: /p:Configuration=Release
The above works fine with our Orchard 1.8 solutions.

Since version 8.0, TeamCity has a feature that discovers possible build configurations you may want to add (click "Auto-detect build steps" on the Build steps page), it's capable of finding VS solution files and configure a build step to build them automatically.
Jul 29, 2014 at 5:53 PM
I did log in as Guest, but because Guest doesn't allow administration, I am unable to see the build setps. Also, in this case, AutoDetect only came up with the Command Line steps for <root>/*.cmd.

Is the MSBuild steps running Orchard.proj? Can you confirm the Targets (There is no Rebuild target in Orchard.proj).
Jul 29, 2014 at 8:50 PM
I tried putting this on our own TeamCity server to support a client project. The Server is a VM running Windows Server 2012 (v6.2) and has TeamCity v8.1.4. The project is executing the v1.8.1 Source Code downloaded from Codeplex. (I have also tried the 1.8.x branch code from Git, and the same results.)

My Build Configuration settings within TeamCity:
MSBuild Step
Build file path: Orchard.proj
MSBuild Version: MS .NET Framework 4.5
MSBuild Tools Version: 4.0
Run platform: x86 (I have also tried x64)
Targets: Build
Command Line Params: None (I've also tried /p:Configuration=Release)

It fails--"nunit-console.exe" exited with code 255--after executing just over 500 of the tests:
[15:16:46][Orchard.Framework.Tests.dll] Orchard.Tests.FileSystems.LockFile.LockFileManagerTests.AcquiringLockShouldBeThreadSafe (running for 3s)
[15:16:45][NUnit] .NHibernate: select shelldescr0_.Id as Id88_, shelldescr0_.SerialNumber as SerialNu2_88_ from Test_ShellDescriptorRecord shelldescr0_
[15:16:45][NUnit] NHibernate: INSERT INTO Test_ShellDescriptorRecord (SerialNumber) VALUES (@p0);@p0 = 1 [Type: Int32 (0)]
[15:16:45][NUnit] NHibernate: select @@IDENTITY
[15:16:45][NUnit] .NHibernate: select shelldescr0_.Id as Id91_, shelldescr0_.SerialNumber as SerialNu2_91_ from Test_ShellDescriptorRecord shelldescr0_
[15:16:45][NUnit] NHibernate: INSERT INTO Test_ShellDescriptorRecord (SerialNumber) VALUES (@p0);@p0 = 1 [Type: Int32 (0)]
[15:16:45][NUnit] NHibernate: select @@IDENTITY
[15:16:47][NUnit] ...................................................................................2014-07-29 15:16:47,116 [1684] WARN  JetBrains.Container.Log4netDefaultLoggerInitializer - Unhandled exception in current domain: NUnit.Framework.AssertionException:   Expected: 1
[15:16:47][NUnit]   But was:  2
[15:16:47][NUnit] 
[15:16:47][NUnit]    at NUnit.Framework.Assert.That(Object actual, IResolveConstraint expression, String message, Object[] args)
[15:16:47][NUnit]    at Orchard.Tests.FileSystems.LockFile.LockFileManagerTests.PlayWithAcquire() in c:\TeamCity\buildAgent\work\82173c35eddea2b1\src\Orchard.Tests\FileSystems\LockFile\LockFileManagerTests.cs:line 175
[15:16:47][NUnit]    at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
[15:16:47][NUnit]    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
[15:16:47][NUnit]    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
[15:16:47][NUnit]    at System.Threading.ThreadHelper.ThreadStart(),    at NUnit.Framework.Assert.That(Object actual, IResolveConstraint expression, String message, Object[] args)
[15:16:47][NUnit]    at Orchard.Tests.FileSystems.LockFile.LockFileManagerTests.PlayWithAcquire() in c:\TeamCity\buildAgent\work\82173c35eddea2b1\src\Orchard.Tests\FileSystems\LockFile\LockFileManagerTests.cs:line 175
[15:16:47][NUnit]    at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
[15:16:47][NUnit]    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
[15:16:47][NUnit]    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
[15:16:47][NUnit]    at System.Threading.ThreadHelper.ThreadStart(), (null)
[15:16:47][NUnit] 
[15:16:47][NUnit] Unhandled Exception: NUnit.Framework.AssertionException:   Expected: 1
[15:16:47][NUnit]   But was:  2
[15:16:47][NUnit] 
[15:16:47][NUnit]    at NUnit.Framework.Assert.That(Object actual, IResolveConstraint expression, String message, Object[] args)
[15:16:47][NUnit]    at Orchard.Tests.FileSystems.LockFile.LockFileManagerTests.PlayWithAcquire() in c:\TeamCity\buildAgent\work\82173c35eddea2b1\src\Orchard.Tests\FileSystems\LockFile\LockFileManagerTests.cs:line 175
[15:16:47][NUnit]    at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
[15:16:47][NUnit]    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
[15:16:47][NUnit]    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
[15:16:47][NUnit]    at System.Threading.ThreadHelper.ThreadStart()
[15:16:49][NUnit] C:\TeamCity\buildAgent\work\82173c35eddea2b1\Orchard.proj(145, 5): error MSB6006: "nunit-console.exe" exited with code 255.
Developer
Jul 30, 2014 at 10:26 AM
Edited Jul 30, 2014 at 10:28 AM
No, you need to build an .sln file (e.g. Orchard.sln, but it's a good practice to have your own one based on Orchard.sln). I don't remember any scenario where you'd have to run the build on Orchard.proj.