Skip to content

Commit

Permalink
Merge pull request #6 from kamranayub/patch-optional-destination
Browse files Browse the repository at this point in the history
Allow optional destination computer
  • Loading branch information
rschiefer committed Feb 6, 2017
2 parents 2d25249 + a8d2930 commit 93dbb1c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
15 changes: 11 additions & 4 deletions Tasks/MSDeployPackageSync/MSDeployPackageSync.ps1
Expand Up @@ -8,10 +8,10 @@ param
[String] [Parameter(Mandatory = $true)]
$DestinationProvider,

[String] [Parameter(Mandatory = $true)]
[String] [Parameter(Mandatory = $false)]
$DestinationComputer,

[String] [Parameter(Mandatory = $true)]
[String] [Parameter(Mandatory = $false)]
$AuthType,

[String] [Parameter(Mandatory = $false)]
Expand Down Expand Up @@ -82,10 +82,17 @@ $msdeploy = Join-Path $InstallPath "msdeploy.exe"

Write-Host "Deploying $($packageFile.FileName) package to $DestinationComputer"

$remoteArguments = "computerName='$DestinationComputer',userName='$UserName',password='$Password',authType='$AuthType',"

if (-not $DestinationComputer -or -not $AuthType) {
Write-Host "No destination or authType defined, performing local operation"
$remoteArguments = ""
}

[string[]] $arguments =
"-verb:sync",
"-source:package='$packageFile'",
"-dest:$DestinationProvider,computerName='$DestinationComputer',userName='$UserName',password='$Password',authType='$AuthType',includeAcls='False'",
"-dest:$DestinationProvider,$($remoteArguments)includeAcls='False'",
#"-setParam:name='IIS", "Web", "Application", ("Name',value='" + $webApp + "'"),
"-allowUntrusted"

Expand All @@ -110,4 +117,4 @@ Write-Verbose "Leaving script MSDeployPackageSync.ps1"
# -DestinationComputer 'https://testingvirtualapps.scm.azurewebsites.net:443/msdeploy.axd?site=TestingVirtualApps' -AuthType 'basic' -DoNotDelete 'FALSE' -Use
# rname '$TestingVirtualApps' -Password 'Rvs7kwDcuPxAfq2EKLoqRQgWhxBkcNlGrzLzfomQsvFF74Rdi3tohRMhRPrh' -AdditionalArguments "-setParamFile:C:\temp\rootSitePack
# age\RootSite.SetParameters.xml"
# Package= C:\temp\rootSitePackage\rootsite.zip
# Package= C:\temp\rootSitePackage\rootsite.zip
6 changes: 3 additions & 3 deletions Tasks/MSDeployPackageSync/task.json
Expand Up @@ -44,8 +44,8 @@
"type": "string",
"label": "Destination Computer",
"defaultValue": "",
"required": true,
"helpMarkDown": "The destination computer to deploy the MSDeploy package to. For an Azure website the format should be https://[SiteName].scm.azurewebsites.net:443/msdeploy.axd?site=[SiteName].",
"required": false,
"helpMarkDown": "The destination computer to deploy the MSDeploy package to. If blank, will perform operations on agent machine. For an Azure website the format should be https://[SiteName].scm.azurewebsites.net:443/msdeploy.axd?site=[SiteName].",
"properties": {
"EditableOptions": "True"
}
Expand All @@ -55,7 +55,7 @@
"type": "string",
"label": "AuthType",
"defaultValue": "ntlm",
"required": true,
"required": false,
"properties": {
"EditableOptions": "True"
}
Expand Down

0 comments on commit 93dbb1c

Please sign in to comment.