From 3fc6565d4aa340a0aae7dcf9dcd4767c585455db Mon Sep 17 00:00:00 2001 From: Olga Naidjonoka Date: Tue, 26 Mar 2024 10:56:45 +0200 Subject: [PATCH] updated step commands --- .buildkite/auditbeat/auditbeat-pipeline.yml | 10 +++++----- .buildkite/filebeat/filebeat-pipeline.yml | 22 ++++++++------------- .buildkite/heartbeat/heartbeat-pipeline.yml | 21 +++++++------------- .buildkite/hooks/pre-command | 2 ++ .buildkite/scripts/win-tests.ps1 | 21 -------------------- auditbeat/magefile.go | 4 ---- filebeat/docker-compose.yml | 2 +- 7 files changed, 23 insertions(+), 59 deletions(-) delete mode 100644 .buildkite/scripts/win-tests.ps1 diff --git a/.buildkite/auditbeat/auditbeat-pipeline.yml b/.buildkite/auditbeat/auditbeat-pipeline.yml index eed9c208b668..547ba71b459f 100644 --- a/.buildkite/auditbeat/auditbeat-pipeline.yml +++ b/.buildkite/auditbeat/auditbeat-pipeline.yml @@ -24,7 +24,7 @@ steps: steps: - label: ":ubuntu: Unit Tests" - command: mage -d "${BEATS_PROJECT_NAME}" unitTest + command: "mage -d ${BEATS_PROJECT_NAME} unitTest" notify: - github_commit_status: context: "Auditbeat: linux/Unit Tests" @@ -37,7 +37,7 @@ steps: - "auditbeat/build/*.json" - label: ":rhel: Unit Tests" - command: mage -d "${BEATS_PROJECT_NAME}" unitTest + command: "mage -d ${BEATS_PROJECT_NAME} unitTest" notify: - github_commit_status: context: "Auditbeat: rhel/Unit Tests" @@ -83,7 +83,7 @@ steps: - label: ":linux: Crosscompile" command: - - ".buildkite/auditbeat/scripts/crosscompile.sh" + - "make -C auditbeat crosscompile" env: GOX_FLAGS: "-arch amd64" notify: @@ -102,7 +102,7 @@ steps: - label: ":linux: ARM64 Unit Tests" key: "arm-extended" if: build.env("GITHUB_PR_TRIGGER_COMMENT") == "auditbeat for arm" || build.env("GITHUB_PR_LABELS") =~ /.*arm.*/ - command: mage -d "${BEATS_PROJECT_NAME}" unitTest + command: "mage -d ${BEATS_PROJECT_NAME} unitTest" notify: - github_commit_status: context: "Auditbeat: Unit Tests ARM" @@ -115,7 +115,7 @@ steps: - label: ":mac: MacOS Unit Tests" key: "macos-extended" if: build.env("GITHUB_PR_TRIGGER_COMMENT") == "auditbeat for macos" || build.env("GITHUB_PR_LABELS") =~ /.*macOS.*/ - command: mage -d "${BEATS_PROJECT_NAME}" unitTest + command: "mage -d ${BEATS_PROJECT_NAME} unitTest" notify: - github_commit_status: context: "Auditbeat: MacOS Unit Tests" diff --git a/.buildkite/filebeat/filebeat-pipeline.yml b/.buildkite/filebeat/filebeat-pipeline.yml index 2678dada46f4..f311f6b6f4e3 100644 --- a/.buildkite/filebeat/filebeat-pipeline.yml +++ b/.buildkite/filebeat/filebeat-pipeline.yml @@ -23,8 +23,7 @@ steps: steps: - label: ":ubuntu: Unit Tests" - command: - - ".buildkite/filebeat/scripts/unit-tests.sh" + command: "mage -d ${BEATS_PROJECT_NAME} unitTest" notify: - github_commit_status: context: "Filebeat: linux/Unit Tests" @@ -37,8 +36,7 @@ steps: - "filebeat/build/*.json" - label: ":ubuntu: Go Integration Tests" - command: - - ".buildkite/filebeat/scripts/integration-gotests.sh" + command: "mage -d ${BEATS_PROJECT_NAME} goIntegTest" notify: - github_commit_status: context: "Filebeat: Go Integration Tests" @@ -51,8 +49,7 @@ steps: - "filebeat/build/*.json" - label: ":ubuntu: Python Integration Tests" - command: - - ".buildkite/filebeat/scripts/integration-pytests.sh" + command: "mage -d ${BEATS_PROJECT_NAME} pythonIntegTest" notify: - github_commit_status: context: "Filebeat: Python Integration Tests" @@ -104,8 +101,7 @@ steps: - label: ":linux: ARM64 Unit Tests" key: "arm-extended" if: build.env("GITHUB_PR_TRIGGER_COMMENT") == "filebeat for arm" || build.env("GITHUB_PR_LABELS") =~ /.*arm.*/ - command: - - ".buildkite/filebeat/scripts/unit-tests.sh" + command: "mage -d ${BEATS_PROJECT_NAME} unitTest" notify: - github_commit_status: context: "Filebeat: Unit Tests ARM" @@ -118,8 +114,7 @@ steps: - label: ":mac: MacOS Unit Tests" key: "macos-extended" if: build.env("GITHUB_PR_TRIGGER_COMMENT") == "filebeat for macos" || build.env("GITHUB_PR_LABELS") =~ /.*macOS.*/ - command: - - ".buildkite/filebeat/scripts/unit-tests.sh" + command: "mage -d ${BEATS_PROJECT_NAME} unitTest" notify: - github_commit_status: context: "Filebeat: MacOS Unit Tests" @@ -131,8 +126,7 @@ steps: - label: ":mac: MacOS ARM Unit Tests" key: "macos-extended-arm" if: build.env("GITHUB_PR_TRIGGER_COMMENT") == "filebeat for macos" || build.env("GITHUB_PR_LABELS") =~ /.*macOS.*/ - command: - - ".buildkite/filebeat/scripts/unit-tests.sh" + command: "mage -d ${BEATS_PROJECT_NAME} unitTest" notify: - github_commit_status: context: "Filebeat: MacOS ARM Unit Tests" @@ -151,7 +145,7 @@ steps: command: "mage -d ${BEATS_PROJECT_NAME} build unitTest" notify: - github_commit_status: - context: "Filebea: Win-2019 Unit Tests" + context: "Filebeat: Win-2019 Unit Tests" agents: provider: "gcp" image: "${IMAGE_WIN_2019}" @@ -183,7 +177,7 @@ steps: command: "mage -d ${BEATS_PROJECT_NAME} build unitTest" notify: - github_commit_status: - context: "Filebea: Win-10 Unit Tests" + context: "Filebeat: Win-10 Unit Tests" agents: provider: "gcp" image: "${IMAGE_WIN_10}" diff --git a/.buildkite/heartbeat/heartbeat-pipeline.yml b/.buildkite/heartbeat/heartbeat-pipeline.yml index 4bb582ae21cd..1d32df6e5363 100644 --- a/.buildkite/heartbeat/heartbeat-pipeline.yml +++ b/.buildkite/heartbeat/heartbeat-pipeline.yml @@ -24,8 +24,7 @@ steps: steps: - label: ":ubuntu: Unit Tests" - command: - - ".buildkite/heartbeat/scripts/unit-tests.sh" + command: "mage -d ${BEATS_PROJECT_NAME} unitTest" notify: - github_commit_status: context: "Heartbeat: ubuntu/Unit Tests" @@ -38,8 +37,7 @@ steps: - "heartbeat/build/*.json" - label: ":rhel:-9 Unit Tests" - command: - - ".buildkite/heartbeat/scripts/unit-tests.sh" + command: "mage -d ${BEATS_PROJECT_NAME} unitTest" notify: - github_commit_status: context: "Heartbeat: rhel-9/Unit Tests" @@ -82,8 +80,7 @@ steps: - "heartbeat/build/*.json" - label: ":ubuntu: Go Integration Tests" - command: - - ".buildkite/heartbeat/scripts/integration-gotests.sh" + command: "mage -d ${BEATS_PROJECT_NAME} goIntegTest" notify: - github_commit_status: context: "Heartbeat: Go Integration Tests" @@ -96,8 +93,7 @@ steps: - "heartbeat/build/*.json" - label: ":ubuntu: Python Integration Tests" - command: - - ".buildkite/heartbeat/scripts/integration-pytests.sh" + command: "mage -d ${BEATS_PROJECT_NAME} pythonIntegTest" notify: - github_commit_status: context: "Heartbeat: Python Integration Tests" @@ -117,8 +113,7 @@ steps: - label: ":linux: ARM64 Unit Tests" key: "arm-extended" if: build.env("GITHUB_PR_TRIGGER_COMMENT") == "heartbeat for arm" || build.env("GITHUB_PR_LABELS") =~ /.*arm.*/ - command: - - ".buildkite/heartbeat/scripts/unit-tests.sh" + command: "mage -d ${BEATS_PROJECT_NAME} unitTest" notify: - github_commit_status: context: "Heartbeat: Unit Tests ARM" @@ -131,8 +126,7 @@ steps: - label: ":mac: MacOS Unit Tests" key: "macos-extended" if: build.env("GITHUB_PR_TRIGGER_COMMENT") == "heartbeat for macos" || build.env("GITHUB_PR_LABELS") =~ /.*macOS.*/ - command: - - ".buildkite/heartbeat/scripts/unit-tests.sh" + command: "mage -d ${BEATS_PROJECT_NAME} unitTest" notify: - github_commit_status: context: "Heartbeat: MacOS Unit Tests" @@ -144,8 +138,7 @@ steps: - label: ":mac: MacOS ARM Unit Tests" key: "macos-extended-arm" if: build.env("GITHUB_PR_TRIGGER_COMMENT") == "heartbeat for macos" || build.env("GITHUB_PR_LABELS") =~ /.*macOS.*/ - command: - - ".buildkite/heartbeat/scripts/unit-tests.sh" + command: "mage -d ${BEATS_PROJECT_NAME} unitTest" notify: - github_commit_status: context: "Heartbeat: MacOS ARM Unit Tests" diff --git a/.buildkite/hooks/pre-command b/.buildkite/hooks/pre-command index 30bb92799395..acf7a78111b1 100644 --- a/.buildkite/hooks/pre-command +++ b/.buildkite/hooks/pre-command @@ -21,6 +21,8 @@ if [[ "$BUILDKITE_PIPELINE_SLUG" == "filebeat" || "$BUILDKITE_PIPELINE_SLUG" == git reset --quiet --hard fi + # Images with prefix "platform-ingest-beats-*" has Go pre-setup. + # Image itself takes care of Go version download/installation based on .go-version file if [[ "$BUILDKITE_STEP_KEY" == macos* ]]; then if [[ -z "${GO_VERSION-""}" ]]; then GO_VERSION=$(cat "${WORKSPACE}/.go-version") diff --git a/.buildkite/scripts/win-tests.ps1 b/.buildkite/scripts/win-tests.ps1 deleted file mode 100644 index 68a1be87e134..000000000000 --- a/.buildkite/scripts/win-tests.ps1 +++ /dev/null @@ -1,21 +0,0 @@ -$ErrorActionPreference = "Stop" # set -e - -# Forcing to checkout again all the files with a correct autocrlf. -# Doing this here because we cannot set git clone options before. -function fixCRLF { - Write-Host "-- Fixing CRLF in git checkout --" - git config core.autocrlf false - git rm --quiet --cached -r . - git reset --quiet --hard -} - -fixCRLF - -$ErrorActionPreference = "Continue" # set +e - -mage -d $env:BEATS_PROJECT_NAME build unitTest - -$EXITCODE=$LASTEXITCODE -$ErrorActionPreference = "Stop" - -Exit $EXITCODE diff --git a/auditbeat/magefile.go b/auditbeat/magefile.go index 0e6e2b487d52..1f17ed60fae6 100644 --- a/auditbeat/magefile.go +++ b/auditbeat/magefile.go @@ -21,8 +21,6 @@ package main import ( "fmt" - "log" - "os" "time" "github.com/magefile/mage/mg" @@ -97,8 +95,6 @@ func Package() { start := time.Now() defer func() { fmt.Println("package ran for", time.Since(start)) }() - log.SetOutput(os.Stdout) - devtools.UseElasticBeatOSSPackaging() devtools.PackageKibanaDashboardsFromBuildDir() auditbeat.CustomizePackaging(auditbeat.OSSPackaging) diff --git a/filebeat/docker-compose.yml b/filebeat/docker-compose.yml index 36be6159aae5..80d7eb6a7ff3 100644 --- a/filebeat/docker-compose.yml +++ b/filebeat/docker-compose.yml @@ -46,6 +46,6 @@ services: - 1883:1883 redis: - build: ${PWD}/input/redis/_meta + build: ${ES_BEATS}/filebeat/input/redis/_meta ports: - 6379:6379