Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow optional destination computer #6

Merged
merged 2 commits into from Feb 6, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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