Last active
August 29, 2015 13:57
-
-
Save rodolfofadino/9808985 to your computer and use it in GitHub Desktop.
Deploy WebSite and Manage NLB
This file contains hidden or 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
$SiteOrigem="C:\inetpub\wwwroot\xxxx" | |
$TimeOut=5 | |
$Servers = New-Object System.Collections.ArrayList | |
$Servers.Add(@{Ip="xxx.xxx.xxx";Path="E:\xxxx";Urls=("/","/appx")}) | |
$Servers.Add(@{Ip="xxx.xxx.xxx";Path="F:\xxxx";Urls=("/","/appx")}) | |
$Servers.Add(@{Ip="xxx.xxx.xxx";Path="G:\xxxx";Urls=("/","/appx")}) | |
$Servers.Add(@{Ip="xxx.xxx.xxx";Path="H:\xxxx";Urls=("/","/appx")}) | |
foreach($Server in $Servers) | |
{ | |
Write-Host "-----Iniciando deploy------" | |
Write-Host $Server.Ip | |
Write-Host "-----Retirando do NBL------" | |
Stop-NlbClusterNode -Hostname $Server.Ip | |
Start-Sleep -Second $TimeOut | |
Write-Host "-----Copiando Arquivos------" | |
robocopy $SiteOrigem $Server.Path /S /E | |
Start-Sleep -Second $TimeOut | |
foreach($Url in $Server.Urls){ | |
Write-Host "-----Acessando Url------" | |
$s=$Server.Ip | |
Write-Host http://$s$Url | |
$request = [System.Net.WebRequest]::Create("http://$s$Url") | |
$response=$request.GetResponse() | |
$response.Close() | |
} | |
Start-Sleep -Second $TimeOut | |
Write-Host "-----Colocando no NBL------" | |
Start-NlbClusterNode -Hostname $Server.Ip | |
Write-Host $Server.Ip | |
Write-Host "-----Fim deploy------" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment