Created
January 28, 2014 00:09
-
-
Save blair55/8659981 to your computer and use it in GitHub Desktop.
Decoupling your Web Deploy Build Script from Team City with Powershell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-ScriptDirectory | |
{ | |
$Invocation = (Get-Variable MyInvocation -Scope 1).Value | |
Split-Path $Invocation.MyCommand.Path | |
} | |
$targets = $env:TargetDeployUrls -split "," | |
foreach ($t in $targets) | |
{ | |
$tt = $t.trim() | |
$path = Join-Path (Get-ScriptDirectory) fluid.card.web.deploy.cmd | |
Write-Host '-----------------------------------------' | |
Write-Host 'Start Deploy to' $tt | |
$args = @" | |
/y /M:$tt /u:$env:Username /p:$env:Password /A:Basic -allowUntrusted | |
" -setParam:name='LoggingEmailAddress',value='$env:LoggingEmailAddress' " | |
" -setParam:name='ServiceEndPoint',value='$env:ServiceEndPoint' " | |
"@ | |
$cleanArgs = $args -replace "`n"," " -replace "`r"," " | |
$executable = $path + $cleanArgs | |
Write-Host 'Executable' $executable | |
iex $executable | |
Write-Host 'End Deploy to' $tt | |
Write-Host '-----------------------------------------' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment