-
-
Notifications
You must be signed in to change notification settings - Fork 82
/
sonar-prep.ps1
32 lines (27 loc) · 998 Bytes
/
sonar-prep.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
$buildDir = $env:AGENT_BUILDDIRECTORY
$sourceDir = $env:BUILD_SOURCESDIRECTORY
$version = 2.3
# Get-ChildItem -Path Env:\ | Format-List
write-host "Agent.BuildDirectory: " $buildDir
write-host "Build.SourcesDirectoy: " $sourceDir
write-host "Version: " $version
if ("main" -ne $env:BUILD_SOURCEBRANCHNAME)
{
$pullrequest = $true
$source = $env:BUILD_SOURCEBRANCH
$base = $env:SYSTEM_PULLREQUEST_TARGETBRANCH
$branch = $env:SYSTEM_PULLREQUEST_SOURCEBRANCH
$key = $env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER
Write-Host "PR Yes: " $pullrequest
Write-Host "soruce: " $source
Write-Host "sonar.pullrequest.base: " $base
Write-Host "sonar.pullrequest.branch: " $branch
Write-Host "sonar.pullrequest.key: " $key
}
else
{
$pullrequest = $false
$base = "main"
Write-Host "PR Not: " $pullrequest
Write-Host "sonar.branch.name: " $base
}