This project is read-only.

Development workflow

Topics: General
Dec 10, 2014 at 11:39 AM
Edited Dec 10, 2014 at 11:40 AM

We are starting on a large project using Orchard as a content management base for an intranet application with many bespoke features and integration to other systems.

The team working on the project are experienced C# developers with an MVC background, and are used to using TFS for source control, build and deployment.

We are struggling to identify a workflow that will allow continuous integration, test and deployment, specifically the deployment phase.

Is there any advice on how to structure the project and get TFS to build and deploy the site?

Ideally we don't want to include the whole Orchard codebase in every deployment, as we are trying not to alter the core in any way but put all our custom code into modules.

Any advice would be welcome as this is giving us a headache .

Dec 15, 2014 at 9:09 PM
I'm not saying that you have to, but you should really, really consider dropping TFS. It is simply a horrible fit. I'm not surprised that it's giving you a headache. Sorry. I'm afraid the only advice I can give you is to start learning git. It's where the industry is going anyway.
Dec 16, 2014 at 8:29 AM
Thanks for the reply. I have some exposure to Git, but it's not been used at this company before. I am still not sure how to achieve the goal of continuous deployment even if we switch source control to Git, we would still need to use some form of continuous integration tool, like TeamCity or Jenkins. How do most people using Orchard achieve this ?
Dec 16, 2014 at 9:34 AM
Edited Dec 16, 2014 at 9:35 AM
I currently use Github and Teamcity, TeamCity builds the latest code, this is easy to setup. The next step is to deploy that build out. I use Robocopy to deploy an entire build over to another server using a set of teamcity agent steps. My steps are....
  1. Create App Offline file.
ECHO Creating App offline File

type NUL > %env.server.fullpath%\app_offline.htm

ECHO Done Creating App offline File
  1. Delete all Orchard caching files.
if exist %env.server.appdata%\Dependencies (
    ECHO Deleting Dependencies
    ECHO %env.server.appdata%\Dependencies /S /Q
    RMDIR %env.server.appdata%\Dependencies /S /Q

if exist %env.server.appdata%\cache.dat (
    ECHO Deleting cache.dat
    ECHO %env.server.appdata%\cache.dat /q /f
    DEL %env.server.appdata%\cache.dat /q /f

if exist %env.server.appdata%\hrestart.txt (
    ECHO Deleting hrestart.txt
    ECHO %env.server.appdata%\hrestart.txt /q /f
    DEL %env.server.appdata%\hrestart.txt /q /f

if exist %env.server.appdata%\?mappings.bin (
    ECHO Deleting mappings.bin
    ECHO %env.server.appdata%\?mappings.bin /q /f
    DEL %env.server.appdata%\?mappings.bin /q /f
  1. Move Orchard
ECHO %env.server.fullpath% /user:%env.USERDOMAIN%\%env.USERNAME%
net use %env.server.fullpath% /user:%env.USERDOMAIN%\%env.USERNAME%

ECHO Robo Copy new stuff
(ROBOCOPY %env.server.fullpath% *.* /MIR /XA:SH /XJD /MT:32 /XD App_Data Media /XF app_offline.htm) ^& IF %ERRORLEVEL% LEQ 1 exit 0
  1. Delete App offline
ECHO Deleting app_offline.htm
ECHO %env.server.fullpath%\app_offline.htm /q /f
DEL %env.server.fullpath%\app_offline.htm /q /f
You are robo copying to a share.

This method although works.... Its terribly inefficient but saved alot of time! (It only took me a day to get this working)

What I would have liked to have done is to use something like OctoDeploy to publish assets out, and also use A/B switching in IIS.
Dec 16, 2014 at 10:05 AM
Thanks JetSki. That's about where I'd got to this morning :) One of the constraints we've placed on ourselves is that we will not modify the core Orchard code ( as it's so well architected for extension ) If we are working on a module or theme we should be able to use the same process to precompile it and xcopy just those projects to the server, that would be more efficient?
Dec 16, 2014 at 3:10 PM
That's a good constraint to have - but I would always advocate having the full solution open when developing - maybe just because it works well for me, its like having all the examples on how to do something right there.

When you say precompile, you mean the orchard source is not built every time? If you have an SSD, this should be super quick.

Yeah just robocopy the individual modules across... that would be supper quick!