Skip to content

Commit

Permalink
add pre exit hook for integration test cleanup (elastic#3462)
Browse files Browse the repository at this point in the history
* add pre-exit buildkite hook for integration test cleanup

---------

Co-authored-by: Alexandros Sapranidis <[email protected]>
  • Loading branch information
pchila and alexsapran authored Sep 26, 2023
1 parent 0c43005 commit 60a9bc5
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .buildkite/hooks/pre-exit
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

set -eo pipefail

if [[ "$BUILDKITE_PIPELINE_SLUG" == "elastic-agent" && "$BUILDKITE_STEP_KEY" == "integration-tests" ]]; then
if [[ -z "${WORKSPACE-""}" ]]; then
WORKSPACE=$(git rev-parse --show-toplevel)
fi
source "${WORKSPACE}/.buildkite/scripts/common.sh"

# Perform cleanup of integration tests resources
echo "--- Cleaning up integration test resources"
TEST_INTEG_AUTH_ESS_REGION=azure-eastus2 SNAPSHOT=true mage integration:clean
fi

if [ -n "$GOOGLE_APPLICATION_CREDENTIALS" ]; then
if test -f "$GOOGLE_APPLICATION_CREDENTIALS"; then
rm $GOOGLE_APPLICATION_CREDENTIALS
Expand Down

0 comments on commit 60a9bc5

Please sign in to comment.