I am creating an application to automate application deployment (https://github.com/twistedtwig/AutomdatedDeployments#readme).
The idea is that everything is in source control, application files, application configuration, as well as IIS configuration. My application allows automatic deployment of the solution (adding the postp assembly setp to the sln / proj file) after the assembly to the dev machine. This will allow the CI server to automatically deploy to your computer for testing, as well as the CI server, which promotes successful builds on QA / Test / production servers. One of the problems I encounter in msdeploy is the requirement that IIS must be configured using the website / application before starting work (which my application is trying to work around).
While I can create, update and delete, application pools, websites and applications through configuration files automatically. I can perfectly synchronize files and folders. The final step was to use the / target: package switch in msbuild to create clean file structures for web deployments. For example, I would execute a command like:
msbuild.exe myMvcSite.csproj /target:clean /target:package /p:Configuration=Release /p:_PackageTempDir=C:\websites\mySite /p:PackageLocation=C:\dropLocation\mySite.zip
This creates a good zip file with the internal path to the file "C_C \ wbesites \ mySite" ready (as I understand it) to synchronize it with the production server.
My problem is how I deploy this zip file. I want it not to depend on IIS information, i.e. I just push the files / folders to the location (either on the local computer for developers, or remotely for testing, etc.). Install IIS with application pools and sites, etc. Will take care separately. Some of the commands (and their output) that I tried are listed below:
"C:\Program Files\IIS\Microsoft Web Deploy v2\msdeploy.exe" -verb:sync -source:package="C:\Temp\deploy\installer\test\testPackage.zip" -dest:auto Info: Adding sitemanifest (sitemanifest). Error: The application pool that you are trying to use has the 'managedRuntimeVersion' property set to 'v2.0'. This application requires 'v4.0'. Error count: 1.
and
"C:\Program Files\IIS\Microsoft Web Deploy v2\msdeploy.exe" -verb:sync -source:package="C:\website\installer\testPackage.zip" -dest:contentpath=C:\temp\mytest Error: Source (sitemanifest) and destination (contentPath) are not compatible for the given operation. Error count: 1.
The first command I'm trying to resolve is unpacking files with the structure that it has. This seems to be frustrated due to the application for the application pool (which I don't want it to touch).
Secondly, I'm trying to bypass the "auto" bit, but that is not good either.
I am struggling to find a lot of information about this process.
The only way I can figure out how to do this at the moment is not to use msdeploy for it, but to create my own task to integrate the file structure and synchronize the files with myself (not perfect).