Fix pipeline (#895)
* Set the Configuration to 'Release' by default if not specified
This commit is contained in:
Родитель
83da4866d4
Коммит
d3189efea9
12
Build.ps1
12
Build.ps1
|
@ -4,9 +4,15 @@
|
|||
[string]$packageSuffix = "0",
|
||||
[bool]$isLocal = $false,
|
||||
[string]$outputDirectory = (Join-Path -Path $PSScriptRoot -ChildPath "buildoutput"),
|
||||
[bool]$pack = $false
|
||||
[bool]$pack = $false,
|
||||
[string]$Configuration
|
||||
)
|
||||
|
||||
if (-not $Configuration) {
|
||||
Write-Host "Configuration not specified, defaulting to 'Release'" -ForegroundColor Yellow
|
||||
$Configuration = 'Release'
|
||||
}
|
||||
|
||||
if ($null -eq $buildNumber) {
|
||||
throw 'Parameter $buildNumber cannot be null or empty. Exiting script.'
|
||||
}
|
||||
|
@ -25,7 +31,7 @@ foreach ($project in $projects)
|
|||
# This assumes we've already built the package
|
||||
if ($pack)
|
||||
{
|
||||
$cmd = "pack", "src\$project\$project.csproj", "-o", $outputDirectory, "--no-build"
|
||||
$cmd = "pack", "src\$project\$project.csproj", "-c", $Configuration, "-o", $outputDirectory, "--no-build"
|
||||
|
||||
if ($packageSuffix -ne "0")
|
||||
{
|
||||
|
@ -34,7 +40,7 @@ foreach ($project in $projects)
|
|||
}
|
||||
else
|
||||
{
|
||||
$cmd = "build", "src\$project\$project.csproj", "-v", "m"
|
||||
$cmd = "build", "-c", $Configuration, "src\$project\$project.csproj", "-v", "m"
|
||||
}
|
||||
|
||||
Write-Host dotnet $cmd
|
||||
|
|
|
@ -62,7 +62,7 @@ jobs:
|
|||
Write-Host $testsArray -separator "`n"
|
||||
|
||||
# building tests will automatically build the main project as well
|
||||
.\run-tests.ps1 -tests $testsArray
|
||||
.\run-tests.ps1 -tests $testsArray -Configuration $env:Configuration
|
||||
displayName: "Build and test"
|
||||
env:
|
||||
CommitHash: $(Build.SourceVersion)
|
||||
|
@ -146,7 +146,7 @@ jobs:
|
|||
Write-Host "Building projects:"
|
||||
Write-Host $projectsArray -separator "`n"
|
||||
|
||||
.\Build.ps1 -projects $projectsArray -buildNumber "$(buildNumber)" -packageSuffix "$packageSuffix" -outputDirectory "$(buildOutputDirectory)" -pack $True
|
||||
.\Build.ps1 -projects $projectsArray -buildNumber "$(buildNumber)" -packageSuffix "$packageSuffix" -outputDirectory "$(buildOutputDirectory)" -pack $True -Configuration $env:Configuration
|
||||
displayName: "Pack build"
|
||||
|
||||
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@2
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
param(
|
||||
[string[]]$tests = @()
|
||||
[string[]]$tests = @(),
|
||||
[string]$Configuration
|
||||
)
|
||||
|
||||
if (-not $Configuration) {
|
||||
Write-Host "Configuration not specified, defaulting to 'Release'" -ForegroundColor Yellow
|
||||
$Configuration = 'Release'
|
||||
}
|
||||
|
||||
function RunTest([string]$project, [bool]$skipBuild = $false, [string]$filter = $null) {
|
||||
Write-Host "Running test: $project" -ForegroundColor DarkCyan
|
||||
Write-Host "-----------------------------------------------------------------------------" -ForegroundColor DarkCyan
|
||||
Write-Host
|
||||
|
||||
$cmdargs = "test", ".\test\$project\$project.csproj", "-v", "m", "--logger", "trx;LogFileName=TEST.xml"
|
||||
|
||||
if ($null -ne $env:Configuration)
|
||||
{
|
||||
Write-Host "Adding: --configuration $env:Configuration"
|
||||
$cmdargs += "--configuration", "$env:Configuration"
|
||||
}
|
||||
$cmdargs = "test", ".\test\$project\$project.csproj", "-v", "m", "--logger", "trx;LogFileName=TEST.xml", "-c", $Configuration
|
||||
|
||||
if ($filter) {
|
||||
Write-Host "Adding: --filter $filter"
|
||||
|
@ -54,7 +54,7 @@ Write-Host "Current TimeZone: '$originalTZ'"
|
|||
Set-TimeZone -Name "Pacific Standard Time"
|
||||
$currentTZ = Get-TimeZone
|
||||
Write-Host "Changing TimeZone for Timer tests. Now '$currentTZ'"
|
||||
Write-Host "Environment setting Configuration is '$env:Configuration'."
|
||||
Write-Host "Environment setting Configuration is '$Configuration'."
|
||||
|
||||
dotnet --version
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче