Skip to content

Commit

Permalink
test module definition
Browse files Browse the repository at this point in the history
  • Loading branch information
oakrizan committed May 16, 2024
1 parent aa8be00 commit b6525ce
Show file tree
Hide file tree
Showing 19 changed files with 670 additions and 832 deletions.
112 changes: 58 additions & 54 deletions .buildkite/env-scripts/env.sh
Original file line number Diff line number Diff line change
@@ -1,54 +1,58 @@
#!/usr/bin/env bash

source .buildkite/env-scripts/util.sh

DOCS_CHANGESET="^.*\.(asciidoc|md)$
deploy/kubernetes/.*-kubernetes.yaml"
PACKAGING_CHANGESET="^dev-tools/packaging/
^.go-version"

REPO="beats"
WORKSPACE="$(pwd)"
BIN="${WORKSPACE}/bin"
HW_TYPE="$(uname -m)"
PLATFORM_TYPE="$(uname)"
SNAPSHOT="true"
PYTEST_ADDOPTS=""

SETUP_GVM_VERSION="v0.5.1"
ASDF_MAGE_VERSION="1.14.0"
SETUP_WIN_PYTHON_VERSION="3.11.0"

# Docker & DockerHub
DOCKER_COMPOSE_VERSION="1.21.0"
DOCKER_REGISTRY="docker.elastic.co"

ONLY_DOCS=$(changeset_applies "$DOCS_CHANGESET")
PACKAGING_CHANGES=$(changeset_applies "$PACKAGING_CHANGESET")
GO_MOD_CHANGES=$(changeset_applies "^go.mod")

KIND_VERSION="v0.20.0"
KUBECONFIG="${WORKSPACE}/kubecfg"

export WORKSPACE
export BIN
export HW_TYPE
export PLATFORM_TYPE
export SNAPSHOT
export PYTEST_ADDOPTS

export SETUP_GVM_VERSION
export ASDF_MAGE_VERSION
export SETUP_WIN_PYTHON_VERSION

export DOCKER_COMPOSE_VERSION
export DOCKER_REGISTRY

export ONLY_DOCS
export PACKAGING_CHANGES
export GO_MOD_CHANGES

export KIND_VERSION
export KUBECONFIG

add_bin_path
##!/usr/bin/env bash
#
#source .buildkite/env-scripts/util.sh
#
#DOCS_CHANGESET="^.*\.(asciidoc|md)$
#deploy/kubernetes/.*-kubernetes.yaml"
#PACKAGING_CHANGESET="^dev-tools/packaging/
#^.go-version"
#
#REPO="beats"
#WORKSPACE="$(pwd)"
#BIN="${WORKSPACE}/bin"
#HW_TYPE="$(uname -m)"
#PLATFORM_TYPE="$(uname)"
#SNAPSHOT="true"
#PYTEST_ADDOPTS=""
#OSS_MODULE_PATTERN="^[a-z0-9]+beat\\/module\\/([^\\/]+)\\/.*"
#XPACK_MODULE_PATTERN="^x-pack\\/[a-z0-9]+beat\\/module\\/([^\\/]+)\\/.*"
#
#SETUP_GVM_VERSION="v0.5.1"
#ASDF_MAGE_VERSION="1.14.0"
#SETUP_WIN_PYTHON_VERSION="3.11.0"
#
## Docker & DockerHub
#DOCKER_COMPOSE_VERSION="1.21.0"
#DOCKER_REGISTRY="docker.elastic.co"
#
#ONLY_DOCS=$(changeset_applies "$DOCS_CHANGESET")
#PACKAGING_CHANGES=$(changeset_applies "$PACKAGING_CHANGESET")
#GO_MOD_CHANGES=$(changeset_applies "^go.mod")
#
#KIND_VERSION="v0.20.0"
#KUBECONFIG="${WORKSPACE}/kubecfg"
#
#export REPO
#export WORKSPACE
#export BIN
#export HW_TYPE
#export PLATFORM_TYPE
#export SNAPSHOT
#export PYTEST_ADDOPTS
#export OSS_MODULE_PATTERN
#export XPACK_MODULE_PATTERN
#
#export SETUP_GVM_VERSION
#export ASDF_MAGE_VERSION
#export SETUP_WIN_PYTHON_VERSION
#
#export DOCKER_COMPOSE_VERSION
#export DOCKER_REGISTRY
#
#export ONLY_DOCS
#export PACKAGING_CHANGES
#export GO_MOD_CHANGES
#
#export KIND_VERSION
#export KUBECONFIG
#
37 changes: 0 additions & 37 deletions .buildkite/env-scripts/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,40 +102,3 @@ set_git_config() {
git config user.name "${GITHUB_USERNAME_SECRET}"
git config user.email "${GITHUB_EMAIL_SECRET}"
}

changeset_applies() {
local changeset=$1
if are_files_changed "$changeset"; then
echo true
else
echo false
fi
}

unset_secrets () {
for var in $(printenv | sed 's;=.*;;' | sort); do
if [[ "$var" == *_SECRET || "$var" == *_TOKEN ]]; then
unset "$var"
fi
done
}

google_cloud_logout_active_account() {
local active_account=$(gcloud auth list --filter=status:ACTIVE --format="value(account)" 2>/dev/null)
if [[ -n "$active_account" && -n "${GOOGLE_APPLICATION_CREDENTIALS+x}" ]]; then
echo "Logging out from GCP for active account"
gcloud auth revoke $active_account > /dev/null 2>&1
else
echo "No active GCP accounts found."
fi
if [ -n "${GOOGLE_APPLICATION_CREDENTIALS+x}" ]; then
unset GOOGLE_APPLICATION_CREDENTIALS
cleanup
fi
}

cleanup() {
echo "Deleting temporary files..."
rm -rf ${BIN}/${TMP_FOLDER}.*
echo "Done."
}
30 changes: 0 additions & 30 deletions .buildkite/filebeat/scripts/packaging/package-util.sh

This file was deleted.

49 changes: 0 additions & 49 deletions .buildkite/filebeat/scripts/packaging/package.sh

This file was deleted.

33 changes: 0 additions & 33 deletions .buildkite/filebeat/scripts/packaging/packaging-env.sh

This file was deleted.

Loading

0 comments on commit b6525ce

Please sign in to comment.