This project is read-only.

Continuous Deployment using Teamcity

Topics: Administration
Oct 20, 2012 at 11:22 AM
Edited Oct 20, 2012 at 11:24 AM

I am trying to deploy an Orchard solution using TeamCity. I'm using Orchard 1.5.1 source code and the latest TeamCity version. My current deployment configuration involves building the Orchard.proj with the "compile;package" targets and then copying the files with xcopy using build\MsDeploy\Orchard as a working directory

xcopy *.* C:\inetpub\wwwroot\OrchardPortal /E /H /Y /O

I also have another step that runs some powershell commands to update the settings file.

Rename-item Settings.txt -NewName Settings.txt.OLD

xcopy Settings.txt C:\inetpub\wwwroot\OrchardPortal\App_Data\Sites\Default /E /H /Y /O

Rename-Item Settings.txt.QA -NewName Settings.txt

Rename-Item Settings.txt -NewName Settings.txt.QA

Rename-item Settings.txt.OLD -NewName Settings.txt

The problem that I have is that the media items don't get copied. I could use another xcopy command but I already feel that this deployment process isn't natural. Can anyone provide a better deployment setup? I've noticed that the source code is compiled using TeamCity but the configuration isn't public. 

Oct 20, 2012 at 8:52 PM

The source code is compiled using TeamCity, yes, but the goal here is very different: it's to provide the release packages, not to deploy a web site. So there is no media folder to deploy for example.

Oct 21, 2012 at 1:23 PM

Shouldn't there be some sort of 'best practices' documenting the configuration of a CI server? There's a page devoted to it ( and granted that it's also addressing the business end of source distribution.

How's real-world CI (deploy to web site) configuration look?

Oct 21, 2012 at 7:40 PM

There's an effort underway to refresh and extend the documentation. It would be great to contribute any results you are getting to that topic.

I can give you a copy of the TeamCity configuration we have to build the releases. Would that help?

Oct 22, 2012 at 2:51 PM

I wrote a wrapper .proj file for my site. It calls into the Orchard.proj "Precompiled" target, and adds custom steps after to overlay things like config files, media folder, and module.txt for custom modules into the build/staging that Orchard.proj creates. Then it makes a .zip with the build version in the file name. 

I'm not doing CI, but you could use the same methods in a CI process. 

Oct 24, 2012 at 2:20 PM

It would be a great starting point, thank you.

Oct 25, 2012 at 7:48 AM

There's quite a lot of stuff in there and unfortunately I don't think you can export the settings into one file. Is there any particular area you're interested in?

Oct 29, 2012 at 11:16 AM

I'm mostly interested in the build steps, more precisely the steps that compile the package and the ones that gather all the required resources.

Oct 29, 2012 at 7:27 PM

Here is our continuous build config: