Skip to content

Commit

Permalink
updated auditbeat & deploy k8s pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
oakrizan committed Mar 27, 2024
1 parent 23ec4e9 commit 41bd6e8
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 71 deletions.
7 changes: 3 additions & 4 deletions .buildkite/auditbeat/auditbeat-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,20 @@
name: "beats-auditbeat"

env:
AWS_IMAGE_UBUNTU_ARM_64: "platform-ingest-beats-ubuntu-2004-aarch64"
BEATS_PROJECT_NAME: "auditbeat"
IMAGE_UBUNTU_X86_64: "family/platform-ingest-beats-ubuntu-2204"
IMAGE_UBUNTU_ARM_64: "platform-ingest-beats-ubuntu-2204-aarch64"
AWS_IMAGE_UBUNTU_ARM_64: "platform-ingest-beats-ubuntu-2004-aarch64"
IMAGE_RHEL9: "family/platform-ingest-beats-rhel-9"
IMAGE_WIN_10: "family/platform-ingest-beats-windows-10"
IMAGE_WIN_11: "family/platform-ingest-beats-windows-11"
IMAGE_WIN_2016: "family/platform-ingest-beats-windows-2016"
IMAGE_WIN_2019: "family/platform-ingest-beats-windows-2019"
IMAGE_WIN_2022: "family/platform-ingest-beats-windows-2022"
IMAGE_MACOS_X86_64: "generic-13-ventura-x64"
BEATS_PROJECT_NAME: "auditbeat"
GCP_DEFAULT_MACHINE_TYPE: "c2d-highcpu-8"
GCP_HI_PERF_MACHINE_TYPE: "c2d-highcpu-16"
GCP_WIN_MACHINE_TYPE: "n2-standard-8"
AWS_ARM_INSTANCE_TYPE: "t4g.xlarge"
AWS_ARM_INSTANCE_TYPE: "m6g.xlarge"

steps:
- input: "Input Parameters"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,77 +6,69 @@ set -euo pipefail

pipelineName="pipeline.auditbeat-dynamic.yml"

# TODO: steps: must be always included
# TODO: steps: must be always included
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: "Auditbeat Mandatory Testing"
key: "mandatory-tests"
key: "mandatory-tests"
steps:
- label: ":ubuntu: Unit Tests"
command:
- ".buildkite/auditbeat/scripts/unit-tests.sh"
command: "cd ${BEATS_PROJECT_NAME} && mage unitTest"
notify:
- github_commit_status:
context: "Auditbeat: linux/Unit Tests"
agents:
provider: "gcp"
image: "${IMAGE_UBUNTU_X86_64}"
machineType: "${GCP_DEFAULT_MACHINE_TYPE}"
artifact_paths:
- "auditbeat/build/*.xml"
- "auditbeat/build/*.json"
artifact_paths: "${BEATS_PROJECT_NAME}/build/*.*"
- label: ":rhel: Unit Tests"
command:
- ".buildkite/auditbeat/scripts/unit-tests.sh"
command: "cd ${BEATS_PROJECT_NAME} && mage unitTest"
notify:
- github_commit_status:
context: "Auditbeat: rhel/Unit Tests"
agents:
provider: "gcp"
image: "${IMAGE_RHEL9}"
machineType: "${GCP_DEFAULT_MACHINE_TYPE}"
artifact_paths:
- "auditbeat/build/*.xml"
- "auditbeat/build/*.json"
artifact_paths: "${BEATS_PROJECT_NAME}/build/*.*"
- label: ":windows:-2016 Unit Tests"
command: ".buildkite/scripts/win_unit_tests.ps1"
key: "windows-2016"
command: "mage -d ${BEATS_PROJECT_NAME} unitTest"
notify:
- github_commit_status:
context: "Auditbeat: windows 2016/Unit Tests"
context: "Auditbeat: windows-2016/Unit Tests"
agents:
provider: "gcp"
image: "${IMAGE_WIN_2016}"
machine_type: "${GCP_WIN_MACHINE_TYPE}"
disk_size: 200
disk_type: "pd-ssd"
artifact_paths:
- "auditbeat/build/*.xml"
- "auditbeat/build/*.json"
disk_type: "pd-ssd"
artifact_paths: "${BEATS_PROJECT_NAME}/build/*.*"
- label: ":windows:-2022 Unit Tests"
command: ".buildkite/scripts/win_unit_tests.ps1"
key: "windows-2022"
command: "mage -d ${BEATS_PROJECT_NAME} unitTest"
notify:
- github_commit_status:
context: "Auditbeat: windows 2022/Unit Tests"
context: "Auditbeat: windows-2022/Unit Tests"
agents:
provider: "gcp"
image: "${IMAGE_WIN_2022}"
machine_type: "${GCP_WIN_MACHINE_TYPE}"
disk_size: 200
disk_type: "pd-ssd"
artifact_paths:
- "auditbeat/build/*.xml"
- "auditbeat/build/*.json"
disk_type: "pd-ssd"
artifact_paths: "${BEATS_PROJECT_NAME}/build/*.*"
- label: ":linux: Crosscompile"
command:
- ".buildkite/auditbeat/scripts/crosscompile.sh"
- "make -C auditbeat crosscompile"
env:
GOX_FLAGS: "-arch amd64"
notify:
Expand All @@ -102,81 +94,82 @@ if are_conditions_met_arm_tests; then
- label: ":arm: ARM64 Unit Tests"
key: "extended-arm64-unit-tests"
command: ".buildkite/scripts/unit_tests.sh"
notify:
- github_commit_status:
context: "Auditbeat: ARM Unit tests"
agents:
provider: "gcp"
image: "${IMAGE_UBUNTU_ARM64}"
image: "${AWS_IMAGE_UBUNTU_ARM_64}"
machineType: "${GCP_DEFAULT_MACHINE_TYPE}"
artifact_paths: "${BEATS_PROJECT_NAME}/build/*.*"
notify:
- github_commit_status:
context: "Auditbeat: ARM Unit tests"
YAML
fi

if are_conditions_met_win_tests; then
cat >> $pipelineName <<- YAML
- group: "Windows Extended Testing"
key: "extended-tests-win"
steps:
- label: ":windows: Windows 2019 Unit Tests"
key: "extended-win-2019-unit-tests"
command: ".buildkite/scripts/win_unit_tests.ps1"
- label: ":windows:-2019 Unit Tests"
key: "windows-extended-2019"
command: "mage -d ${BEATS_PROJECT_NAME} unitTest"
notify:
- github_commit_status:
context: "Auditbeat: Win-2019 Unit Tests"
agents:
provider: "gcp"
image: "${IMAGE_WIN_2019}"
machine_type: "${GCP_WIN_MACHINE_TYPE}"
disk_size: 100
disk_size: 200
disk_type: "pd-ssd"
artifact_paths: "${BEATS_PROJECT_NAME}/build/*.*"
- label: ":windows:-11 Unit Tests"
key: "windows-extended-11"
command: "mage -d ${BEATS_PROJECT_NAME} unitTest"
notify:
- github_commit_status:
context: "Auditbeat: Windows 2019 Unit Tests"
- label: ":windows: Windows 10 Unit Tests"
key: "extended-win-10-unit-tests"
command: ".buildkite/scripts/win_unit_tests.ps1"
context: "Auditbeat: Win-11 Unit Tests"
agents:
provider: "gcp"
image: "${IMAGE_WIN_10}"
image: "${IMAGE_WIN_11}"
machine_type: "${GCP_WIN_MACHINE_TYPE}"
disk_size: 100
disk_size: 200
disk_type: "pd-ssd"
artifact_paths: "${BEATS_PROJECT_NAME}/build/*.*"
- label: ":windows:-10 Unit Tests"
key: "windows-extended-10"
command: "mage -d ${BEATS_PROJECT_NAME} unitTest"
notify:
- github_commit_status:
context: "Auditbeat: Windows 10 Unit Tests"
- label: ":windows: Windows 11 Unit Tests"
key: "extended-win-11-unit-tests"
command: ".buildkite/scripts/win_unit_tests.ps1"
context: "Auditbeat: Win-10 Unit Tests"
agents:
provider: "gcp"
image: "${IMAGE_WIN_11}"
image: "${IMAGE_WIN_10}"
machine_type: "${GCP_WIN_MACHINE_TYPE}"
disk_size: 100
disk_size: 200
disk_type: "pd-ssd"
artifact_paths: "${BEATS_PROJECT_NAME}/build/*.*"
notify:
- github_commit_status:
context: "Auditbeat: Windows 11 Unit Tests"
YAML
fi

echo "Check and add the Packaging into the pipeline"
if are_conditions_met_packaging; then
cat >> $pipelineName <<- YAML
- group: "Packaging"
key: "packaging"
key: "packaging"
depends_on:
- "mandatory-tests"
steps:
- label: Package pipeline
commands: ".buildkite/scripts/packaging/package-step.sh"
notify:
- github_commit_status:
context: "Auditbeat: Packaging"
YAML
fi

Expand Down
6 changes: 0 additions & 6 deletions .buildkite/auditbeat/scripts/crosscompile.sh

This file was deleted.

9 changes: 0 additions & 9 deletions .buildkite/auditbeat/scripts/unit-tests.sh

This file was deleted.

0 comments on commit 41bd6e8

Please sign in to comment.