Skip to content

Instantly share code, notes, and snippets.

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")
# 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)
}
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);
:SETVAR DatabasePrefix xp0
:SETVAR UserName collectionuser
:SETVAR Password Test12345
:SETVAR ShardMapManagerDatabaseNameSuffix _Xdb.Collection.ShardMapManager
:SETVAR Shard0DatabaseNameSuffix _Xdb.Collection.Shard0
:SETVAR Shard1DatabaseNameSuffix _Xdb.Collection.Shard1
GO
IF(SUSER_ID('$(UserName)') IS NULL)