Skip to content

Instantly share code, notes, and snippets.

@MarioBinder
Created September 16, 2019 05:36
Show Gist options
  • Select an option

  • Save MarioBinder/5a13c6f408b34bf81305086cf7e00dd7 to your computer and use it in GitHub Desktop.

Select an option

Save MarioBinder/5a13c6f408b34bf81305086cf7e00dd7 to your computer and use it in GitHub Desktop.
Webdeploy Script #teamcity

Webdeploy (MSBuild)

/p:Configuration=%BuildConfiguration% //INT
/p:LastUsedBuildConfiguration=%BuildConfiguration% //INT
/p:PublishProfile=%DeployConfig% //Properties/PublishProfiles
/p:DeployIisAppPath=%WebDeployIisAppPath% //path to iis website
/p:UserName=%WebDeployUser%
/p:Password=%WebDeployPwd%
/p:AspnetMergePath=%AspnetMergePath% //"C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools"

Properties/PublishProfiles

<?xml version="1.0" encoding="utf-8"?>
<!--
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
by editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121. 
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <WebPublishMethod>MSDeploy</WebPublishMethod>

    <AllowUntrustedCertificate>True</AllowUntrustedCertificate>
    <DebugSymbols>False</DebugSymbols>
    <DeployOnBuild>True</DeployOnBuild>
    <EnableUpdateable>True</EnableUpdateable>
    <ExcludeApp_Data>False</ExcludeApp_Data>
    <ExcludeFilesFromDeployment>gulpfile.js;modernizr-config.json;package.json;packages.config;vendor.json;ReadMe.txt</ExcludeFilesFromDeployment>
    <ExcludeFoldersFromDeployment>Properties</ExcludeFoldersFromDeployment>
    <LastUsedPlatform>Any CPU</LastUsedPlatform>
    <LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
    <MSDeployServiceURL>hw-srv-web3</MSDeployServiceURL>
    <PrecompileBeforePublish>True</PrecompileBeforePublish>
    <RemoteSitePhysicalPath />
    <SiteUrlToLaunchAfterPublish />          
    <SkipExtraFilesOnServer>False</SkipExtraFilesOnServer>
    <_SavePWD>False</_SavePWD>
  </PropertyGroup>
  <PropertyGroup>
    <CopyAllFilesToSingleFolderForMSDeployDependsOn>
      CustomCollectFiles;
      $(CopyAllFilesToSingleFolderForMSDeployDependsOn);
    </CopyAllFilesToSingleFolderForMSDeployDependsOn>
  </PropertyGroup>
  <Target Name="CustomCollectFiles">
    <ItemGroup>
      <_CustomFiles Include="bin\swagger.xml" />
      <FilesForPackagingFromProject Include="%(_CustomFiles.Identity)">
        <DestinationRelativePath>bin\%(Filename)%(Extension)</DestinationRelativePath>
      </FilesForPackagingFromProject>
    </ItemGroup>
  </Target>
</Project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment