-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.yml
128 lines (124 loc) · 4.39 KB
/
config.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
version: 2.1
jobs:
list-packages:
parameters:
image-tag:
type: string
machine:
image: windows-server-2019-vs2019:<< parameters.image-tag >>
resource_class: windows.medium
steps:
- run:
name: List uninstallers
shell: powershell.exe
command: |
Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, DisplayVersion, Publisher, InstallDate | Format-Table –AutoSize | Out-File uninstallers-<< parameters.image-tag >>.txt
- run:
name: List packages installed with chocolatey
shell: bash.exe
command: choco list --local-only > chocolatey-<< parameters.image-tag >>.txt
- run:
name: Copy the list of managed components
shell: cmd.exe
command: cp C:\InstalledSoftware.md managed-<< parameters.image-tag >>.md
- store_artifacts:
path: uninstallers-<< parameters.image-tag >>.txt
- store_artifacts:
path: chocolatey-<< parameters.image-tag >>.txt
- store_artifacts:
path: managed-<< parameters.image-tag >>.md
- persist_to_workspace:
root: .
paths:
- uninstallers-<< parameters.image-tag >>.txt
- chocolatey-<< parameters.image-tag >>.txt
- managed-<< parameters.image-tag >>.md
compare:
parameters:
a:
type: string
b:
type: string
docker:
- image: debian:bullseye-slim
steps:
- run:
name: Install dependencies
command: |
apt update
apt install -y tar diffutils
- attach_workspace:
at: .
- run: ls
- run:
name: diff uninstallers
command: |
iconv -f UTF-16LE -t UTF-8 uninstallers-<< parameters.a >>.txt | tail -n +4 | sort -b > uninstallers-<< parameters.a >>.u8.txt
iconv -f UTF-16LE -t UTF-8 uninstallers-<< parameters.b >>.txt | tail -n +4 | sort -b > uninstallers-<< parameters.b >>.u8.txt
bash -c '(diff -u uninstallers-<< parameters.a >>.u8.txt uninstallers-<< parameters.b >>.u8.txt | tee diff-uninstallers-<< parameters.a >>-<< parameters.b >>.txt) || true'
- run:
name: diff chocolatey
command: bash -c '(diff -u chocolatey-<< parameters.a >>.txt chocolatey-<< parameters.b >>.txt | tee diff-chocolatey-<< parameters.a >>-<< parameters.b >>.txt) || true'
- run:
name: diff managed
command: bash -c '(diff -u managed-<< parameters.a >>.md managed-<< parameters.b >>.md | tee diff-managed-<< parameters.a >>-<< parameters.b >>.txt) || true'
- store_artifacts:
path: diff-uninstallers-<< parameters.a >>-<< parameters.b >>.txt
- store_artifacts:
path: diff-chocolatey-<< parameters.a >>-<< parameters.b >>.txt
- store_artifacts:
path: diff-managed-<< parameters.a >>-<< parameters.b >>.txt
- persist_to_workspace:
root: .
paths:
- diff-uninstallers-<< parameters.a >>-<< parameters.b >>.txt
- diff-chocolatey-<< parameters.a >>-<< parameters.b >>.txt
- diff-managed-<< parameters.a >>-<< parameters.b >>.txt
publish:
docker:
- image: debian:buster-slim
steps:
- run: apt update && apt -y install git
- checkout
- run: mkdir -p dist
- attach_workspace:
at: dist
- run:
name: add & commit & push
command: |
git config user.name "Makoto Mizukami"
git config user.email "[email protected]"
git add -A
git commit -a -m "[ci skip] dist at $(date +%FT%T%:z)"
git push -u origin
workflows:
run:
jobs:
- list-packages:
name: << matrix.image-tag >>
matrix:
parameters:
image-tag:
- stable
- previous
- edge
- compare:
name: compare-<< matrix.a >>-<< matrix.b >>
matrix:
parameters:
a:
- previous
- stable
b:
- stable
- edge
exclude:
- a: previous
b: edge
- a: stable
b: stable
requires:
- list-packages
- publish:
requires:
- compare