-
Notifications
You must be signed in to change notification settings - Fork 4.9k
/
Copy pathgenerate_libbeat_pipeline.sh
executable file
·89 lines (73 loc) · 2.74 KB
/
generate_libbeat_pipeline.sh
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
#!/usr/bin/env bash
source .buildkite/scripts/common.sh
set -euo pipefail
pipelineName="pipeline.libbeat-dynamic.yml"
echo "Add the mandatory and extended tests without additional conditions into the pipeline"
if are_conditions_met_mandatory_tests; then
cat > $pipelineName <<- YAML
steps:
- group: "Mandatory Tests"
key: "mandatory-tests"
steps:
- label: ":linux: Ubuntu Unit Tests"
key: "mandatory-linux-unit-test"
command: ".buildkite/scripts/unit_tests.sh"
agents:
provider: "gcp"
image: "${IMAGE_UBUNTU_X86_64}"
machineType: "${GCP_DEFAULT_MACHINE_TYPE}"
artifact_paths: "${BEATS_PROJECT_NAME}/build/*.xml"
- label: ":go: Go Integration Tests"
key: "mandatory-int-test"
command: ".buildkite/scripts/go_int_tests.sh"
agents:
provider: "gcp"
image: "${IMAGE_UBUNTU_X86_64}"
machineType: "${GCP_HI_PERF_MASHINE_TYPE}"
artifact_paths: "${BEATS_PROJECT_NAME}/build/*.xml"
- label: ":python: Python Integration Tests"
key: "mandatory-python-int-test"
command: ".buildkite/scripts/py_int_tests.sh"
agents:
provider: "gcp"
image: "${IMAGE_UBUNTU_X86_64}"
machineType: "${GCP_HI_PERF_MASHINE_TYPE}"
artifact_paths: "${BEATS_PROJECT_NAME}/build/*.xml"
- label: ":negative_squared_cross_mark: Cross compile"
key: "mandatory-cross-compile"
command: ".buildkite/scripts/crosscompile.sh"
agents:
provider: "gcp"
image: "${IMAGE_UBUNTU_X86_64}"
machineType: "${GCP_HI_PERF_MASHINE_TYPE}"
artifact_paths: " ${BEATS_PROJECT_NAME}/build/*.xml"
- label: ":testengine: Stress Tests"
key: "mandatory-stress-test"
command: ".buildkite/scripts/stress_tests.sh"
agents:
provider: "gcp"
image: "${IMAGE_UBUNTU_X86_64}"
machineType: "${GCP_DEFAULT_MACHINE_TYPE}"
artifact_paths: "${BEATS_PROJECT_NAME}/libbeat-stress-test.xml"
YAML
fi
echo "Check and add the Extended Tests into the pipeline"
if are_conditions_met_libbeat_arm_tests; then
cat >> $pipelineName <<- YAML
- group: "Extended Tests"
key: "extended-tests"
steps:
- label: ":linux: Arm64 Unit Tests"
key: "extended-arm64-unit-tests"
command: ".buildkite/scripts/unit_tests.sh"
agents:
provider: "aws"
imagePrefix: "${IMAGE_UBUNTU_ARM_64}"
instanceType: "${AWS_ARM_INSTANCE_TYPE}"
artifact_paths: "${BEATS_PROJECT_NAME}/build/*.xml"
YAML
fi
echo "--- Printing dynamic steps" #TODO: remove if the pipeline is public
cat $pipelineName
echo "--- Loading dynamic steps"
buildkite-agent pipeline upload $pipelineName