@@ -6,77 +6,69 @@ set -euo pipefail
6
6
7
7
pipelineName=" pipeline.auditbeat-dynamic.yml"
8
8
9
- # TODO: steps: must be always included
9
+ # TODO: steps: must be always included
10
10
echo " Add the mandatory and extended tests without additional conditions into the pipeline"
11
11
if are_conditions_met_mandatory_tests; then
12
12
cat > $pipelineName << - YAML
13
13
14
14
steps:
15
15
- group: "Auditbeat Mandatory Testing"
16
- key: "mandatory-tests"
16
+ key: "mandatory-tests"
17
17
18
18
steps:
19
19
- label: ":ubuntu: Unit Tests"
20
- command:
21
- - ".buildkite/auditbeat/scripts/unit-tests.sh"
20
+ command: "cd ${BEATS_PROJECT_NAME} && mage unitTest"
22
21
notify:
23
22
- github_commit_status:
24
23
context: "Auditbeat: linux/Unit Tests"
25
24
agents:
26
25
provider: "gcp"
27
26
image: "${IMAGE_UBUNTU_X86_64} "
28
27
machineType: "${GCP_DEFAULT_MACHINE_TYPE} "
29
- artifact_paths:
30
- - "auditbeat/build/*.xml"
31
- - "auditbeat/build/*.json"
28
+ artifact_paths: "${BEATS_PROJECT_NAME} /build/*.*"
32
29
33
30
- label: ":rhel: Unit Tests"
34
- command:
35
- - ".buildkite/auditbeat/scripts/unit-tests.sh"
31
+ command: "cd ${BEATS_PROJECT_NAME} && mage unitTest"
36
32
notify:
37
33
- github_commit_status:
38
34
context: "Auditbeat: rhel/Unit Tests"
39
35
agents:
40
36
provider: "gcp"
41
37
image: "${IMAGE_RHEL9} "
42
38
machineType: "${GCP_DEFAULT_MACHINE_TYPE} "
43
- artifact_paths:
44
- - "auditbeat/build/*.xml"
45
- - "auditbeat/build/*.json"
39
+ artifact_paths: "${BEATS_PROJECT_NAME} /build/*.*"
46
40
47
41
- label: ":windows:-2016 Unit Tests"
48
- command: ".buildkite/scripts/win_unit_tests.ps1"
42
+ key: "windows-2016"
43
+ command: "mage -d ${BEATS_PROJECT_NAME} unitTest"
49
44
notify:
50
45
- github_commit_status:
51
- context: "Auditbeat: windows 2016/Unit Tests"
46
+ context: "Auditbeat: windows- 2016/Unit Tests"
52
47
agents:
53
48
provider: "gcp"
54
49
image: "${IMAGE_WIN_2016} "
55
50
machine_type: "${GCP_WIN_MACHINE_TYPE} "
56
51
disk_size: 200
57
- disk_type: "pd-ssd"
58
- artifact_paths:
59
- - "auditbeat/build/*.xml"
60
- - "auditbeat/build/*.json"
52
+ disk_type: "pd-ssd"
53
+ artifact_paths: "${BEATS_PROJECT_NAME} /build/*.*"
61
54
62
55
- label: ":windows:-2022 Unit Tests"
63
- command: ".buildkite/scripts/win_unit_tests.ps1"
56
+ key: "windows-2022"
57
+ command: "mage -d ${BEATS_PROJECT_NAME} unitTest"
64
58
notify:
65
59
- github_commit_status:
66
- context: "Auditbeat: windows 2022/Unit Tests"
60
+ context: "Auditbeat: windows- 2022/Unit Tests"
67
61
agents:
68
62
provider: "gcp"
69
63
image: "${IMAGE_WIN_2022} "
70
64
machine_type: "${GCP_WIN_MACHINE_TYPE} "
71
65
disk_size: 200
72
- disk_type: "pd-ssd"
73
- artifact_paths:
74
- - "auditbeat/build/*.xml"
75
- - "auditbeat/build/*.json"
66
+ disk_type: "pd-ssd"
67
+ artifact_paths: "${BEATS_PROJECT_NAME} /build/*.*"
76
68
77
69
- label: ":linux: Crosscompile"
78
70
command:
79
- - ".buildkite/ auditbeat/scripts/ crosscompile.sh "
71
+ - "make -C auditbeat crosscompile"
80
72
env:
81
73
GOX_FLAGS: "-arch amd64"
82
74
notify:
94
86
95
87
echo " Check and add the Extended Tests into the pipeline"
96
88
97
- if are_conditions_met_arm_tests; then
89
+ if are_conditions_met_arm_tests || are_conditions_met_macos_tests ; then
98
90
cat >> $pipelineName << - YAML
91
+
99
92
- group: "Extended Tests"
100
- key: "extended-tests-arm "
93
+ key: "extended-tests"
101
94
steps:
102
- - label: ":arm: ARM64 Unit Tests"
103
- key: "extended-arm64-unit-tests"
104
- command: ".buildkite/scripts/unit_tests.sh"
95
+
96
+ YAML
97
+ fi
98
+
99
+ if are_conditions_met_macos_tests; then
100
+ cat >> $pipelineName << - YAML
101
+
102
+ - label: ":mac: MacOS Unit Tests"
103
+ key: "macos-unit-tests-extended"
104
+ command: "cd ${BEATS_PROJECT_NAME} && mage unitTest"
105
+ notify:
106
+ - github_commit_status:
107
+ context: "Auditbeat: MacOS Unit Tests"
105
108
agents:
106
- provider: "gcp"
107
- image: "${IMAGE_UBUNTU_ARM64} "
108
- machineType: "${GCP_DEFAULT_MACHINE_TYPE} "
109
+ provider: "orka"
110
+ imagePrefix: "${IMAGE_MACOS_X86_64} "
109
111
artifact_paths: "${BEATS_PROJECT_NAME} /build/*.*"
112
+
113
+ - label: ":mac: MacOS ARM Unit Tests"
114
+ key: "macos-arm64-unit-tests-extended"
115
+ command: "cd ${BEATS_PROJECT_NAME} && mage unitTest"
116
+ notify:
117
+ - github_commit_status:
118
+ context: "Auditbeat: MacOS ARM Unit Tests"
119
+ agents:
120
+ provider: "orka"
121
+ imagePrefix: "${IMAGE_MACOS_ARM} "
122
+ artifact_paths: "${BEATS_PROJECT_NAME} /build/*.*"
123
+
124
+ YAML
125
+ fi
126
+
127
+ if are_conditions_met_arm_tests; then
128
+ cat >> $pipelineName << - YAML
129
+ - label: ":linux: ARM Ubuntu Unit Tests"
130
+ key: "extended-arm64-unit-test"
131
+ command: "cd ${BEATS_PROJECT_NAME} && mage unitTest"
110
132
notify:
111
133
- github_commit_status:
112
- context: "Auditbeat: ARM Unit tests"
134
+ context: "Auditbeat: Unit Tests ARM"
135
+ agents:
136
+ provider: "aws"
137
+ imagePrefix: "${AWS_IMAGE_UBUNTU_ARM_64} "
138
+ instanceType: "${AWS_ARM_INSTANCE_TYPE} "
139
+ artifact_paths: "${BEATS_PROJECT_NAME} /build/*.*"
140
+
113
141
YAML
114
142
fi
115
143
116
144
if are_conditions_met_win_tests; then
117
145
cat >> $pipelineName << - YAML
118
146
- group: "Windows Extended Testing"
119
147
key: "extended-tests-win"
148
+
120
149
steps:
121
- - label: ":windows: Windows 2019 Unit Tests"
122
- key: "extended-win-2019-unit-tests"
123
- command: ".buildkite/scripts/win_unit_tests.ps1"
150
+ - label: ":windows:-2019 Unit Tests"
151
+ key: "windows-2019-extended"
152
+ command: "mage -d ${BEATS_PROJECT_NAME} unitTest"
153
+ notify:
154
+ - github_commit_status:
155
+ context: "Auditbeat: Win-2019 Unit Tests"
124
156
agents:
125
157
provider: "gcp"
126
158
image: "${IMAGE_WIN_2019} "
127
159
machine_type: "${GCP_WIN_MACHINE_TYPE} "
128
- disk_size: 100
160
+ disk_size: 200
129
161
disk_type: "pd-ssd"
130
162
artifact_paths: "${BEATS_PROJECT_NAME} /build/*.*"
163
+
164
+ - label: ":windows:-11 Unit Tests"
165
+ key: "windows-11-extended"
166
+ command: "mage -d ${BEATS_PROJECT_NAME} unitTest"
131
167
notify:
132
168
- github_commit_status:
133
- context: "Auditbeat: Windows 2019 Unit Tests"
134
-
135
- - label: ":windows: Windows 10 Unit Tests"
136
- key: "extended-win-10-unit-tests"
137
- command: ".buildkite/scripts/win_unit_tests.ps1"
169
+ context: "Auditbeat: Win-11 Unit Tests"
138
170
agents:
139
171
provider: "gcp"
140
- image: "${IMAGE_WIN_10 } "
172
+ image: "${IMAGE_WIN_11 } "
141
173
machine_type: "${GCP_WIN_MACHINE_TYPE} "
142
- disk_size: 100
174
+ disk_size: 200
143
175
disk_type: "pd-ssd"
144
176
artifact_paths: "${BEATS_PROJECT_NAME} /build/*.*"
177
+
178
+ - label: ":windows:-10 Unit Tests"
179
+ key: "windows-10-extended"
180
+ command: "mage -d ${BEATS_PROJECT_NAME} unitTest"
145
181
notify:
146
182
- github_commit_status:
147
- context: "Auditbeat: Windows 10 Unit Tests"
148
-
149
- - label: ":windows: Windows 11 Unit Tests"
150
- key: "extended-win-11-unit-tests"
151
- command: ".buildkite/scripts/win_unit_tests.ps1"
183
+ context: "Auditbeat: Win-10 Unit Tests"
152
184
agents:
153
185
provider: "gcp"
154
- image: "${IMAGE_WIN_11 } "
186
+ image: "${IMAGE_WIN_10 } "
155
187
machine_type: "${GCP_WIN_MACHINE_TYPE} "
156
- disk_size: 100
188
+ disk_size: 200
157
189
disk_type: "pd-ssd"
158
190
artifact_paths: "${BEATS_PROJECT_NAME} /build/*.*"
159
- notify:
160
- - github_commit_status:
161
- context: "Auditbeat: Windows 11 Unit Tests"
162
191
YAML
163
192
fi
164
193
165
194
echo " Check and add the Packaging into the pipeline"
166
195
if are_conditions_met_packaging; then
167
196
cat >> $pipelineName << - YAML
168
197
- group: "Packaging"
169
- key: "packaging"
198
+ key: "packaging"
170
199
depends_on:
171
200
- "mandatory-tests"
201
+
172
202
steps:
173
203
- label: Package pipeline
174
204
commands: ".buildkite/scripts/packaging/package-step.sh"
175
205
notify:
176
206
- github_commit_status:
177
207
context: "Auditbeat: Packaging"
178
208
179
-
180
209
YAML
181
210
fi
182
211
0 commit comments