msbuild

Форк
0
/
init-sdl.ps1 
47 строк · 1.8 Кб
1
Param(
2
  [string] $GuardianCliLocation,
3
  [string] $Repository,
4
  [string] $BranchName='master',
5
  [string] $WorkingDirectory,
6
  [string] $GuardianLoggerLevel='Standard'
7
)
8

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

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

20
# Don't display the console progress UI - it's a huge perf hit
21
$ProgressPreference = 'SilentlyContinue'
22

23
Add-Type -AssemblyName System.IO.Compression.FileSystem
24

25
try {
26
  # if the folder does not exist, we'll do a guardian init and push it to the remote repository
27
  Write-Host 'Initializing Guardian...'
28
  Write-Host "$GuardianCliLocation init --working-directory $WorkingDirectory --logger-level $GuardianLoggerLevel"
29
  & $GuardianCliLocation init --working-directory $WorkingDirectory --logger-level $GuardianLoggerLevel
30
  if ($LASTEXITCODE -ne 0) {
31
    Write-PipelineTelemetryError -Force -Category 'Build' -Message "Guardian init failed with exit code $LASTEXITCODE."
32
    ExitWithExitCode $LASTEXITCODE
33
  }
34
  # We create the mainbaseline so it can be edited later
35
  Write-Host "$GuardianCliLocation baseline --working-directory $WorkingDirectory --name mainbaseline"
36
  & $GuardianCliLocation baseline --working-directory $WorkingDirectory --name mainbaseline
37
  if ($LASTEXITCODE -ne 0) {
38
    Write-PipelineTelemetryError -Force -Category 'Build' -Message "Guardian baseline failed with exit code $LASTEXITCODE."
39
    ExitWithExitCode $LASTEXITCODE
40
  }
41
  ExitWithExitCode 0
42
}
43
catch {
44
  Write-Host $_.ScriptStackTrace
45
  Write-PipelineTelemetryError -Force -Category 'Sdl' -Message $_
46
  ExitWithExitCode 1
47
}
48

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

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

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

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