Commit cdf9d033 authored by Nick Craver's avatar Nick Craver

Add -StartServers to build.ps1

This allows running VSTS builds in 1 step.
parent a5517776
...@@ -3,10 +3,11 @@ param( ...@@ -3,10 +3,11 @@ param(
[string] $Version, [string] $Version,
[string] $BuildNumber, [string] $BuildNumber,
[bool] $CreatePackages, [bool] $CreatePackages,
[switch] $StartServers,
[bool] $RunTests = $true, [bool] $RunTests = $true,
[string] $PullRequestNumber [string] $PullRequestNumber
) )
function CalculateVersion() { function CalculateVersion() {
if ($Version) { if ($Version) {
return $Version return $Version
...@@ -65,6 +66,11 @@ if ($PullRequestNumber) { ...@@ -65,6 +66,11 @@ if ($PullRequestNumber) {
} }
if ($RunTests) { if ($RunTests) {
if ($StartServers) {
Write-Host "Starting all servers for testing: $project (all frameworks)" -ForegroundColor "Magenta"
& .\RedisConfigs\start-all.cmd
Write-Host "Servers Started." -ForegroundColor "Green"
}
dotnet restore /ConsoleLoggerParameters:Verbosity=Quiet dotnet restore /ConsoleLoggerParameters:Verbosity=Quiet
foreach ($project in $testsToRun) { foreach ($project in $testsToRun) {
Write-Host "Running tests: $project (all frameworks)" -ForegroundColor "Magenta" Write-Host "Running tests: $project (all frameworks)" -ForegroundColor "Magenta"
...@@ -72,7 +78,7 @@ if ($RunTests) { ...@@ -72,7 +78,7 @@ if ($RunTests) {
Push-Location ".\$project" Push-Location ".\$project"
dotnet xunit -configuration Release dotnet xunit -configuration Release
if ($LastExitCode -ne 0) { if ($LastExitCode -ne 0) {
Write-Host "Error with tests, aborting build." -Foreground "Red" Write-Host "Error with tests, aborting build." -Foreground "Red"
Pop-Location Pop-Location
Exit 1 Exit 1
...@@ -94,7 +100,7 @@ if ($CreatePackages) { ...@@ -94,7 +100,7 @@ if ($CreatePackages) {
foreach ($project in $projectsToBuild) { foreach ($project in $projectsToBuild) {
Write-Host "Working on $project`:" -ForegroundColor "Magenta" Write-Host "Working on $project`:" -ForegroundColor "Magenta"
#Push-Location ".\src\$project" #Push-Location ".\src\$project"
Push-Location ".\$project" Push-Location ".\$project"
...@@ -109,7 +115,7 @@ foreach ($project in $projectsToBuild) { ...@@ -109,7 +115,7 @@ foreach ($project in $projectsToBuild) {
Write-Host "$project... (Version:" -NoNewline -ForegroundColor "Magenta" Write-Host "$project... (Version:" -NoNewline -ForegroundColor "Magenta"
Write-Host $semVer -NoNewline -ForegroundColor "Cyan" Write-Host $semVer -NoNewline -ForegroundColor "Cyan"
Write-Host ")" -ForegroundColor "Magenta" Write-Host ")" -ForegroundColor "Magenta"
dotnet msbuild "/t:$targets" "/p:Configuration=Release" "/p:Version=$semVer" "/p:PackageOutputPath=$packageOutputFolder" "/p:CI=true" dotnet msbuild "/t:$targets" "/p:Configuration=Release" "/p:Version=$semVer" "/p:PackageOutputPath=$packageOutputFolder" "/p:CI=true"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment