Last active
January 20, 2018 14:03
-
-
Save Seddryck/eb50e20a88ea15492b558197de818937 to your computer and use it in GitHub Desktop.
Install Azure Cosmos DB Emulator on AppVeyor
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
install: | |
- ps: Start-FileDownload 'https://aka.ms/cosmosdb-emulator' -FileName 'c:\projects\cosmos-db.msi' | |
- cmd: cmd /c start /wait msiexec /i "c:\projects\cosmos-db.msi" /qn /quiet /norestart /log install.log | |
- ps: Start-Process "start-emulator.cmd" | |
- ps: .\wait-connect-cosmosdb.ps1 |
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
"C:\Program Files\Azure Cosmos DB Emulator\CosmosDB.Emulator.exe" /NoExplorer /NoUI |
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
$attempt = 0; $max = 5 | |
$client = New-Object System.Net.Sockets.TcpClient([System.Net.Sockets.AddressFamily]::InterNetwork) | |
do { | |
try { | |
$client.Connect("127.0.0.1", 8081) | |
write-host "CosmosDB started" | |
} | |
catch { | |
$client.Close() | |
if($attempt -eq $max) { | |
write-host "CosmosDB was not started" | |
} else { | |
[int]$sleepTime = 5 * (++$attempt) | |
write-host "CosmosDB is not started. Retry after $sleepTime seconds..." | |
sleep $sleepTime; | |
} | |
} | |
}while(!$client.Connected -and $attempt -lt $max) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment