سؤال

I'm using this MSBuild command to deploy my web app.

/P:Configuration=Staging 
/P:DeployOnBuild=True 
/P:DeployTarget=MSDeployPublish
/P:MsDeployServiceUrl=192.168.1.5:8172/MsDeploy.axd 
/P:AllowUntrustedCertificate=True 
/P:DeployIisAppPath="Default Web Site/test" 
/P:username=Administrator 
/P:password=***** 
/P:MSDeployPublishMethod=WMSVC

I need to somehow change this configuration to do this:

  1. Exclude some folders from deploy

  2. Deploy a folder which is not part of the project. This folder is created on the build server right before the deploy. It does not exist in the source control.

BTW I'm using Teamcity

هل كانت مفيدة؟

المحلول

You should create a publish profile (via the Publish dialog) that contains all the publish properties, except password, and then execute it via:

/P:Configuration=Staging 
/P:DeployOnBuild=True 
/P:PublishProfile=Test
/P:Password=*****

Exclude some folders from deploy

Add this to your newly created pubxml as a direct child of the root element:

<ItemGroup>
  <MsDeploySkipRules Include="Uploads Folder">
    <ObjectName>dirPath</ObjectName>
    <AbsolutePath>Uploads$</AbsolutePath> <!-- Regex -->
  </MsDeploySkipRules>
</ItemGroup>

Deploy a folder which is not part of the project. This folder is created on the build server right before the deploy. It does not exist in the source control

See this answer

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top