Setting up deploy of orchard project using TeamCity
Asked Answered
T

6

9

We use teamcity to deploy several of our projects. I'm attempting to setup the deploy of an orchard project, and I'm currently running into some issues.

I have the teamcity project building and notifying of successful and failed builds. When I add a deploy step and run it, I get the following error:

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(3460, 5): error MSB4044: The "ConcatFullServiceUrlWithSiteName" task was not given a value for the required parameter "SiteAppName".

I can't tell if it's just me not configuring the build step properly, or if it has trouble with orchard. Has anyone has success deploying orchard projects from TeamCity, and can you help shed some light on this issue?

Taster answered 19/5, 2011 at 15:13 Comment(0)
T
-4

I found the problem, we had some permissions not correctly set for the deploy user on the web server. I was able to give the user correct

Taster answered 6/6, 2011 at 13:33 Comment(4)
This isn't a very good answer for you to accept, I mean it just doesn't add value to others having this issue. I'd love to see you explain what actually solved it. Much appreciatedMultiplicate
Well, I don't actually know what else I can add to this. It was from a long time ago, and I just had to fiddle with the permissions for the user that team city was deploying under on the web server.Taster
I think i have the same problem and I can't figure out what I'm doing wrong. Would love to see an answer of WHAT rights need to be changed to make this work.Lounging
It was a combination of setting the correct site name in publish/package web that Richard remarked on as well as giving the deployment user access to that site's document root in IIS. I don't have access to the server to verify, but you could start with full access and see if that works. Then start to peel off unnecessary permissions until you are back to being secure.Taster
G
27

I had the same problem and fixed it by going to the 'Publish/Package Web' tab in the Visual Studio project settings and specifying the IIS Website name under 'IIS Web site/application name to use on destination server'.

You can also specify DeployIisAppPath as an MS build arguement in TeamCity.

Gyronny answered 20/5, 2011 at 14:56 Comment(2)
We currently moved an app from MVC to MVC 3 and run into this problem, identical error, for the second time. very happy this answer was here!Heimlich
I bet if you remove all but "You can also specify DeployIisAppPath as an MS build arguement in TeamCity." we would have a winner. Thanks!Constant
D
3

Setting the following parameter in the project file settings worked for me.

Default Web Site/MySampleWebSite

Downstate answered 10/4, 2012 at 10:37 Comment(0)
H
2

I added this to the csproj file (manual edit using a text editor)

  <PropertyGroup> ...
   <DeployIisAppPath>mysite</DeployIisAppPath>
  </PropertyGroup>

and that took care of the error...

Hukill answered 31/8, 2012 at 12:57 Comment(0)
R
1

I had no luck deploying Orchard CMS using Visual Studio 2010 1-click Publish. It indeed had some problems with *.targets file.

I think the way it should be published is using Orchard.proj file. It have everything needed to generate proper web deployment package: When you call msbuild /t:Build Orchard.proj, it compiles everything, places proper files at proper locations in temp folders and then generates ~\artifacts\MsDeploy\Orchard.Web.zip. This package is ready to be deployed. You might want to edit manifest.xml and parameters.xml depending on what you want to get done. Same for Orchard.proj: you might want to enable some of disabled modules there etc.

I'm also going to post sample msdeploy script while i'm at it:

deploy.cmd:

@echo off
set site=sitename.com
set user=iis_manager_login
set pass=password
set host=wmsvc='https://hosting.provider.com:8172/msdeploy.axd?site=%site%',userName='%user%',password='%pass%',authtype='Basic'
set cmd=-allowUntrusted -verbose
echo on

::This command puts app_Offline.htm to web application root, asp.net will
::automatically shut down instantly. My hosting provider does not let me use
::recycleApp Provider anyway. I am also not able to use filePath Provider.
::That's why I use contentPath.
msdeploy -verb:sync -source:contentPath='%CD%\lib\msdeploy\app_Offline.htm' -dest:contentPath="%site%\app_Offline.htm",%host% %cmd%

::This is the main deploy command. It will apply every provider listed in
::manifest.xml, applying changed written in parameters.xml.
::It will also skip Media, Settings.txt and app_Offline.htm itself.
::Without skip directive, it would all get removed.
::Deploy will try to delete folders that do not exist in Orchard.Web.zip
::You might have a need to add something like
::<WriteLinesToFile File="$(StageFolder)\App_Data\Sites\Default\_placeholder.txt" Lines="some_text" Overwrite="true"/>
::to your Orchard.proj
msdeploy -verb:sync -source:package='artifacts\MsDeploy\Orchard.Web.zip' -dest:auto,%host% -setParam:name='Application Path',value='%site%' -skip:File='%site%\\App_Data\\Sites.*Settings.txt' -skip:File='%site%\\app_Offline.htm' -skip:Directory='%site%\\Media' %cmd%

::Remove app_Offline.htm, now your site can start up.
msdeploy -verb:delete -dest:contentPath="%site%\app_Offline.htm",%host% %cmd%

Probably this blog post can be helpful.

Rip answered 5/6, 2011 at 22:7 Comment(0)
B
1

Ran into the same error getting my deployments automated using bamboo. In my case I have two projects a web application project and a class library that the web application depends on. When I ran the deployment using the msbuild deployment commandline the class library dependency would build and fail with the missing SiteAppName Error (Looking at the diagnostic logs it appears to be trying to deploy my class library).

To get around the problem I ended building the entire project first and then running the msbuild deployment without rebuilding the class library by adding /p:BuildProjectReferences=false to the msbuild deployment commandline.

Brebner answered 18/12, 2012 at 23:29 Comment(0)
T
-4

I found the problem, we had some permissions not correctly set for the deploy user on the web server. I was able to give the user correct

Taster answered 6/6, 2011 at 13:33 Comment(4)
This isn't a very good answer for you to accept, I mean it just doesn't add value to others having this issue. I'd love to see you explain what actually solved it. Much appreciatedMultiplicate
Well, I don't actually know what else I can add to this. It was from a long time ago, and I just had to fiddle with the permissions for the user that team city was deploying under on the web server.Taster
I think i have the same problem and I can't figure out what I'm doing wrong. Would love to see an answer of WHAT rights need to be changed to make this work.Lounging
It was a combination of setting the correct site name in publish/package web that Richard remarked on as well as giving the deployment user access to that site's document root in IIS. I don't have access to the server to verify, but you could start with full access and see if that works. Then start to peel off unnecessary permissions until you are back to being secure.Taster

© 2022 - 2024 — McMap. All rights reserved.