forked from microsoft/dotnet-framework-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-and-test.ps1
52 lines (49 loc) · 1.12 KB
/
build-and-test.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/usr/bin/env pwsh
[cmdletbinding(
DefaultParameterSetName = "BuildAndTest"
)]
param(
[ValidateSet("runtime", "sdk", "aspnet", "wcf")]
[string[]]$Repos = @(),
[string]$Version = "*",
[string]$OS = "*",
[Parameter(ParameterSetName = "Build")]
[switch]$BuildOnly,
[Parameter(ParameterSetName = "Test")]
[switch]$TestOnly,
[Parameter(ParameterSetName = "Build")]
[Parameter(ParameterSetName = "BuildAndTest")]
[string]$OptionalImageBuilderArgs
)
if ($PSCmdlet.ParameterSetName -eq "BuildAndTest") {
$build = $true
$test = $true
}
else {
$build = $BuildOnly
$test = $TestOnly
}
if ($Repos.Count -eq 0) {
$Path = $null
$testCategories = @()
}
else {
$Path = ""
$Repos | foreach {
$Path += " --path '$Version/$_/$OS'"
}
$testCategories = $Repos
}
if ($build) {
& ./eng/common/build.ps1 `
-Version $Version `
-OS $OS `
-Path $Path `
-OptionalImageBuilderArgs $OptionalImageBuilderArgs
}
if ($test) {
& ./tests/run-tests.ps1 `
-Version $Version `
-OS $OS `
-TestCategories $testCategories
}