-
Notifications
You must be signed in to change notification settings - Fork 7.1k
/
windows-component-governance.yml
71 lines (61 loc) · 2.33 KB
/
windows-component-governance.yml
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
jobs:
- job: ComponentRegistrationJob
variables:
- name: runCodesignValidationInjection
value: false
- name: NugetSecurityAnalysisWarningLevel
value: none
displayName: Component Registration
condition: succeeded()
pool:
name: PowerShell1ES
demands:
- ImageOverride -equals MMS2019TLS
steps:
- checkout: self
clean: true
- template: SetVersionVariables.yml
parameters:
ReleaseTagVar: $(ReleaseTagVar)
- powershell: |
docker container prune --force
docker container ls --all --format '{{ json .ID }}' | ConvertFrom-Json | ForEach-Object {docker container rm --force --volumes $_}
displayName: 'Remove all containers'
# Cleanup is not critical it passes every time it runs
continueOnError: true
- powershell: |
docker image ls --format '{{ json .}}'|ConvertFrom-Json| ForEach-Object {
if($_.tag -eq '<none>')
{
$formatString = 'yyyy-MM-dd HH:mm:ss zz00'
$createdAtString = $_.CreatedAt.substring(0,$_.CreatedAt.Length -4)
$createdAt = [DateTime]::ParseExact($createdAtString, $formatString,[System.Globalization.CultureInfo]::InvariantCulture)
if($createdAt -lt (Get-Date).adddays(-1))
{
docker image rm $_.ID
}
}
}
exit 0
displayName: 'Remove old images'
# Cleanup is not critical it passes every time it runs
continueOnError: true
- powershell: |
Write-verbose "--docker info---" -verbose
docker info
Write-verbose "--docker image ls---" -verbose
docker image ls
Write-verbose "--docker container ls --all---" -verbose
docker container ls --all
displayName: 'Capture Docker Info'
# Diagnostics is not critical it passes every time it runs
continueOnError: true
- template: insert-nuget-config-azfeed.yml
- powershell: |
./tools/releaseBuild/vstsbuild.ps1 -ReleaseTag $(ReleaseTagVar) -Name win-x64-component-registration
displayName: 'Build Windows Universal - Component Registration'
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
displayName: 'Component Detection'
inputs:
sourceScanPath: '$(componentregistration)'
snapshotForceEnabled: true