msbuild

Форк
0
/
run-sdl.ps1 
49 строк · 1.4 Кб
1
Param(
2
  [string] $GuardianCliLocation,
3
  [string] $WorkingDirectory,
4
  [string] $GdnFolder,
5
  [string] $UpdateBaseline,
6
  [string] $GuardianLoggerLevel='Standard'
7
)
8

9
$ErrorActionPreference = 'Stop'
10
Set-StrictMode -Version 2.0
11
$disableConfigureToolsetImport = $true
12
$global:LASTEXITCODE = 0
13

14
try {
15
  # `tools.ps1` checks $ci to perform some actions. Since the SDL
16
  # scripts don't necessarily execute in the same agent that run the
17
  # build.ps1/sh script this variable isn't automatically set.
18
  $ci = $true
19
  . $PSScriptRoot\..\tools.ps1
20

21
  # We store config files in the r directory of .gdn
22
  $gdnConfigPath = Join-Path $GdnFolder 'r'
23
  $ValidPath = Test-Path $GuardianCliLocation
24

25
  if ($ValidPath -eq $False)
26
  {
27
    Write-PipelineTelemetryError -Force -Category 'Sdl' -Message "Invalid Guardian CLI Location."
28
    ExitWithExitCode 1
29
  }
30

31
  $gdnConfigFiles = Get-ChildItem $gdnConfigPath -Recurse -Include '*.gdnconfig'
32
  Write-Host "Discovered Guardian config files:"
33
  $gdnConfigFiles | Out-String | Write-Host
34

35
  Exec-BlockVerbosely {
36
    & $GuardianCliLocation run `
37
      --working-directory $WorkingDirectory `
38
      --baseline mainbaseline `
39
      --update-baseline $UpdateBaseline `
40
      --logger-level $GuardianLoggerLevel `
41
      --config @gdnConfigFiles
42
    Exit-IfNZEC "Sdl"
43
  }
44
}
45
catch {
46
  Write-Host $_.ScriptStackTrace
47
  Write-PipelineTelemetryError -Force -Category 'Sdl' -Message $_
48
  ExitWithExitCode 1
49
}
50

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.