Skip to content

Instantly share code, notes, and snippets.

@rem ---------------------------------------------------------------------------------
@rem Copyright 2008 Microsoft Corporation. All rights reserved.
@rem This is provided as sample to deploy the package using msdeploy.exe
@rem For information about IIS Web Deploy technology,
@rem please visit http://go.microsoft.com/?linkid=9278654
@rem Note: This batch file assumes the package and setparametsrs.xml are in the same folder with this file
@rem ---------------------------------------------------------------------------------
@if %_echo%!==! echo off
setlocal
@rem ---------------------------------------------------------------------------------
# msdeploy argument to set destination IIS App Name for deploy
if($virtualApplication)
{
$msDeployCmdArgs += [String]::Format(' -setParam:name="IIS Web Application Name",value="{0}/{1}"', $webAppNameForMSDeployCmd, $virtualApplication)
}
else
{
$msDeployCmdArgs += [String]::Format(' -setParam:name="IIS Web Application Name",value="{0}"', $webAppNameForMSDeployCmd)
}
FROM ${BUILD_IMAGE} AS builder
ARG FEED_ACCESSTOKEN
ENV VSS_NUGET_EXTERNAL_FEED_ENDPOINTS "{`"endpointCredentials`": [{`"endpoint`":`"https://pkgs.dev.azure.com/<redacted>/_packaging/<redacted>/nuget/v3/index.json`", `"username`":`"docker`", `"password`":`"${FEED_ACCESSTOKEN}`"}]}"
RUN Invoke-WebRequest https://raw.githubusercontent.com/Microsoft/artifacts-credprovider/master/helpers/installcredprovider.ps1 -UseBasicParsing -OutFile "c:\installcredprovider.ps1"
RUN powershell -File ./installcredprovider.ps1 -AddNetfx
{
"endpointCredentials":[
{
"endpoint":"http://example.index.json",
"username":"optional",
"password":"accesstoken"
}
]
}
public class FixPersonalize: Personalize
{
public override void Process(CustomizeRenderingArgs args)
{
Assert.ArgumentNotNull(args, "args");
if (args.IsCustomized)
{
return;
}
Get-ChildItem -Path 'c:\inetpub\*.*' -Filter *.log -Recurse | ? {$_.LastWriteTime -lt (Get-Date).AddDays(-2)} | Remove-Item
[CmdletBinding()]
Param(
[Parameter(Mandatory=$True)]
[string]$PackagePath,
[Parameter(Mandatory=$True)]
[string]$ParamFile,
[Parameter(Mandatory=$False)]
[string]$PackageDestinationPath = $($PackagePath).Replace(".scwdp.zip", "-nodb.scwdp.zip")
export async function isMSDeployPackage(webAppPackage: string ) {
var isParamFilePresent = false;
var pacakgeComponent = await zipUtility.getArchivedEntries(webAppPackage);
if (((pacakgeComponent["entries"].indexOf("parameters.xml") > -1) || (pacakgeComponent["entries"].indexOf("Parameters.xml") > -1)) &&
((pacakgeComponent["entries"].indexOf("systemInfo.xml") > -1) || (pacakgeComponent["entries"].indexOf("systeminfo.xml") > -1))) {
isParamFilePresent = true;
}
tl.debug("Is the package an msdeploy package : " + isParamFilePresent);
return isParamFilePresent;
}
@BasLijten
BasLijten / deployusingmsdeploy.ts
Created April 11, 2018 13:15
is webdeploy package
var isParamFilePresentInPackage = isFolderBasedDeployment ? false : await utility.isMSDeployPackage(webDeployPkg);
var msDeployCmdArgs = msDeployUtility.getMSDeployCmdArgs(webDeployPkg, webAppName, publishingProfile, removeAdditionalFilesFlag,
excludeFilesFromAppDataFlag, takeAppOfflineFlag, virtualApplication, setParametersFileName, additionalArguments, isParamFilePresentInPackage, isFolderBasedDeployment,
useWebDeploy);