Skip to content

Commit

Permalink
Postmigration setenv.sh && common.sh cleanup 7.17 (elastic#40146)
Browse files Browse the repository at this point in the history
Removed unused/unnecessary scripts and updated its' usage in other corresponding scripts
  • Loading branch information
oakrizan authored Jul 15, 2024
1 parent 20a6907 commit 6d85349
Show file tree
Hide file tree
Showing 13 changed files with 45 additions and 595 deletions.
4 changes: 0 additions & 4 deletions .buildkite/auditbeat/auditbeat-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,6 @@ steps:
- label: ":ubuntu: Auditbeat: Crosscompile"
command: |
make -C auditbeat crosscompile
env:
GOX_FLAGS: "-arch amd64"
retry:
automatic:
- limit: 3
Expand Down Expand Up @@ -244,7 +242,6 @@ steps:
key: "auditbeat-package-linux-x86"
env:
PLATFORMS: "+all linux/amd64 linux/arm64 windows/amd64 darwin/amd64"
SNAPSHOT: true
command: |
cd auditbeat
mage package
Expand All @@ -265,7 +262,6 @@ steps:
env:
PLATFORMS: "linux/arm64"
PACKAGES: "docker"
SNAPSHOT: true
command: |
cd auditbeat
mage package
Expand Down
2 changes: 1 addition & 1 deletion .buildkite/deploy/kubernetes/scripts/setup-k8s-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ if [[ ! -d "${BIN}" ]]; then
fi
export PATH="${PATH}:${BIN}"

echo "--- Installing kind & kubectl"
echo "~~~ Installing kind & kubectl"
asdf plugin add kind
asdf install kind "$ASDF_KIND_VERSION"

Expand Down
10 changes: 5 additions & 5 deletions .buildkite/filebeat/filebeat-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,8 @@ steps:
steps:
- label: ":ubuntu: Filebeat: Packaging Linux"
key: "packaging-linux"
env:
PLATFORMS: "+all linux/amd64 linux/arm64 windows/amd64 darwin/amd64"
command: |
cd filebeat
mage package
Expand All @@ -298,14 +300,15 @@ steps:
machineType: "${GCP_HI_PERF_MACHINE_TYPE}"
disk_size: 100
disk_type: "pd-ssd"
env:
PLATFORMS: "+all linux/amd64 linux/arm64 windows/amd64 darwin/amd64"
notify:
- github_commit_status:
context: "filebeat: Packaging Linux"

- label: ":ubuntu: Filebeat: Packaging arm64"
key: "packaging-arm"
env:
PLATFORMS: "linux/arm64"
PACKAGES: "docker"
command: |
cd filebeat
mage package
Expand All @@ -317,9 +320,6 @@ steps:
provider: "aws"
imagePrefix: "${AWS_IMAGE_UBUNTU_ARM_64}"
instanceType: "${AWS_ARM_INSTANCE_TYPE}"
env:
PLATFORMS: "linux/arm64"
PACKAGES: "docker"
notify:
- github_commit_status:
context: "filebeat: Packaging arm64"
3 changes: 1 addition & 2 deletions .buildkite/heartbeat/heartbeat-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ env:

# Other deps
ASDF_MAGE_VERSION: 1.15.0
ASDF_NODEJS_VERSION: 18.17.1

# Unit tests
RACE_DETECTOR: "true"
Expand Down Expand Up @@ -269,7 +270,6 @@ steps:
key: "heartbeat-package-linux"
env:
PLATFORMS: "+all linux/amd64 linux/arm64 windows/amd64 darwin/amd64"
SNAPSHOT: true
command: |
cd heartbeat
mage package
Expand All @@ -290,7 +290,6 @@ steps:
env:
PLATFORMS: "linux/arm64"
PACKAGES: "docker"
SNAPSHOT: true
command: |
cd heartbeat
mage package
Expand Down
42 changes: 21 additions & 21 deletions .buildkite/hooks/pre-command
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,28 @@ set -euo pipefail
# https://buildkite.com/docs/pipelines/managing-log-output#redacted-environment-variables
PRIVATE_CI_GCS_CREDENTIALS_PATH="kv/ci-shared/platform-ingest/gcp-platform-ingest-ci-service-account"

ENABLED_BEATS_PIPELINES_SLUGS=(
"auditbeat"
"heartbeat"
"filebeat"
"beats-metricbeat"
"beats-winlogbeat"
"beats-xpack-winlogbeat"
"beats-xpack-dockerlogbeat"
"beats-xpack-auditbeat"
"beats-xpack-metricbeat"
"beats-xpack-heartbeat"
"deploy-k8s"
)

for slug in "${ENABLED_BEATS_PIPELINES_SLUGS[@]}"; do
if [[ "$BUILDKITE_PIPELINE_SLUG" == "$slug" ]]; then
source .buildkite/scripts/setenv.sh
break
fi
done

if [[ "$BUILDKITE_PIPELINE_SLUG" == "beats-xpack-packetbeat" && "$BUILDKITE_STEP_KEY" == *"system-tests"* ]]; then
PRIVATE_CI_GCS_CREDENTIALS_SECRET=$(retry -t 5 -- vault kv get -field plaintext -format=json ${PRIVATE_CI_GCS_CREDENTIALS_PATH})
export PRIVATE_CI_GCS_CREDENTIALS_SECRET
fi

CPU_ARCH=$(uname -m)
PLATFORM_TYPE=$(uname)

if [[ "${CPU_ARCH}" == "x86_64" ]]; then
case "${PLATFORM_TYPE}" in
Linux|Darwin)
export GOX_FLAGS="-arch amd64"
export GO_ARCH_TYPE="amd64"
;;
MINGW*)
export GOX_FLAGS="-arch 386"
;;
esac
elif [[ "${CPU_ARCH}" == "aarch64" || "${CPU_ARCH}" == "arm64" ]]; then
export GOX_FLAGS="-arch arm"
export GO_ARCH_TYPE="arm64"
else
echo "Unsupported OS"
exit 1
fi
12 changes: 7 additions & 5 deletions .buildkite/metricbeat/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ steps:

- group: "Mandatory Tests"
key: "metricbeat-mandatory-tests"

steps:
- label: ":ubuntu: Metricbeat: Ubuntu x86_64 Unit Tests"
key: "mandatory-linux-unit-test"
Expand Down Expand Up @@ -248,9 +249,12 @@ steps:

- group: "Packaging"
key: "metricbeat-packaging"

steps:
- label: ":ubuntu: Metricbeat: Packaging Linux"
key: "packaging-linux"
env:
PLATFORMS: "+all linux/amd64 linux/arm64 windows/amd64 darwin/amd64"
command: |
cd metricbeat
mage package
Expand All @@ -264,14 +268,15 @@ steps:
machineType: "${GCP_HI_PERF_MACHINE_TYPE}"
disk_size: 100
disk_type: "pd-ssd"
env:
PLATFORMS: "+all linux/amd64 linux/arm64 windows/amd64 darwin/amd64"
notify:
- github_commit_status:
context: "metricbeat: Packaging Linux"

- label: ":ubuntu: Metricbeat: Packaging Linux arm64"
key: "packaging-arm"
env:
PLATFORMS: "linux/arm64"
PACKAGES: "docker"
command: |
cd metricbeat
mage package
Expand All @@ -283,9 +288,6 @@ steps:
provider: "aws"
imagePrefix: "${AWS_IMAGE_UBUNTU_ARM_64}"
instanceType: "${AWS_ARM_INSTANCE_TYPE}"
env:
PLATFORMS: "linux/arm64"
PACKAGES: "docker"
notify:
- github_commit_status:
context: "metricbeat: Packaging Linux arm64"
10 changes: 5 additions & 5 deletions .buildkite/packetbeat/pipeline.packetbeat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ steps:
steps:
- label: ":ubuntu: Packetbeat: Packaging Linux"
key: "packaging-linux"
env:
PLATFORMS: "+all linux/amd64 linux/arm64 windows/amd64 darwin/amd64"
command: |
cd packetbeat
mage package
Expand All @@ -209,14 +211,15 @@ steps:
machineType: "${GCP_HI_PERF_MACHINE_TYPE}"
disk_size: 100
disk_type: "pd-ssd"
env:
PLATFORMS: "+all linux/amd64 linux/arm64 windows/amd64 darwin/amd64"
notify:
- github_commit_status:
context: "packetbeat: Packaging Linux"

- label: ":ubuntu: Packetbeat: Packaging Linux arm64"
key: "packaging-arm"
env:
PLATFORMS: "linux/arm64"
PACKAGES: "docker"
command: |
cd packetbeat
mage package
Expand All @@ -228,9 +231,6 @@ steps:
provider: "aws"
imagePrefix: "${AWS_IMAGE_UBUNTU_ARM_64}"
instanceType: "${AWS_ARM_INSTANCE_TYPE}"
env:
PLATFORMS: "linux/arm64"
PACKAGES: "docker"
notify:
- github_commit_status:
context: "packetbeat: Packaging Linux arm64"
Loading

0 comments on commit 6d85349

Please sign in to comment.